%
% Copyright (C) 2008-2001 by Azzeddine LAZREK. All rights reserved.
%
% amxnsh.tex
% This file belongs to the RyDArab package.
%


% amxnsh family font declaration
\DeclareSymbolFont{amletters}{U}{amxnsh}{m}{n}
\DeclareSymbolFont{amoperators}{U}{amxnsh}{m}{n}

\DeclareMathSizes{12}{10}{8}{6}
\DeclareMathSizes{14}{12}{10}{8}


%
\DeclareRobustCommand\ammathpalette[1]{%
 {\mathchoice
 {\usefont{U}{amxnsh}{m}{n}\fontsize{14}\f@baselineskip
 \selectfont{#1}}%
 {\usefont{U}{amxnsh}{m}{n}\fontsize{12}\f@baselineskip
 \selectfont{#1}}%
 {\usefont{U}{amxnsh}{m}{n}\fontsize{10}\f@baselineskip
 \selectfont{#1}}%
 {\usefont{U}{amxnsh}{m}{n}\fontsize{8}\f@baselineskip
 \selectfont{#1}}}}

\def\am@DeclareMathSymbol#1#2#3#4#5#6{%
 \expandafter\DeclareMathSymbol
 \expandafter{\csname @am#2@\string#3\endcsname}%
 {#4}{#5}{#6}%
 \am@addto#1{\am@mathcodeassign{#2}{#3}}}

%
\def\am@SaveMathSymbolDecl#1#2#3{%
 \expandafter\mathchardef\csname @am#2@\string#3\endcsname
 =\mathcode`#3\relax
 \am@addto#1{\am@mathcodeassign{#2}{#3}}}

%
\def\am@mathcodeassign#1#2{%
 \mathcode`#2=\csname @am#1@\string#2\endcsname}

%
\def\am@addto#1#2{%
 \expandafter\def\expandafter#1\expandafter{#1#2}}

%
\def\am@UndeclareMathSymbol#1#2{%
 \expandafter\let\csname @am#1@\string#2\endcsname=\relax}

%
\def\am@DeclareMathDelimiter#1#2#3#4#5#6#7#8{%
 % save delimiter code and math code of @
 \xdef\am@restoredelmathcode{%
 \delcode`@=\the\delcode`@\relax
 \mathcode`@=\the\mathcode`@\relax}%
 % declare math delimiter (changes delcode and mathcode of @)
 \DeclareMathDelimiter{@}{#4}{#5}{#6}{#7}{#8}%
 % save delcode and mathcode in appropriate csnames
 \expandafter\xdef\csname @am#2@del\string#3\endcsname
 {\the\delcode`@}%
 \expandafter\xdef\csname @am#2@\string#3\endcsname
 {\the\mathcode`@}%
 % restore former delcode and mathcode of @
 \am@restoredelmathcode
 % add delcode and mathcode change commands to #1
 \am@addto#1{\am@delcodeassign{#2}{#3}}%
 \am@addto#1{\am@mathcodeassign{#2}{#3}}}

%
\def\am@SaveMathDelimiterDecl#1#2#3{%
 \expandafter\xdef\csname @am#2@del\string#3\endcsname
 {\the\delcode`#3}%
 \expandafter\xdef\csname @am#2@\string#3\endcsname
 {\the\mathcode`#3}%
 \am@addto#1{\am@delcodeassign{#2}{#3}}%
 \am@addto#1{\am@mathcodeassign{#2}{#3}}}

%
\def\am@delcodeassign#1#2{%
 \delcode`#2=\csname @am#1@del\string#2\endcsname\relax}


% Arabic letters : \amarabletter-amletters
\def\amarabletter{}
\am@DeclareMathSymbol\amarabletter{}{a}{\mathalpha}{amletters}{"40}%
\am@DeclareMathSymbol\amarabletter{}{b}{\mathalpha}{amletters}{"48}%
\am@DeclareMathSymbol\amarabletter{}{j}{\mathalpha}{amletters}{"68}%
\am@DeclareMathSymbol\amarabletter{}{d}{\mathalpha}{amletters}{"58}%
\am@DeclareMathSymbol\amarabletter{}{w}{\mathalpha}{amletters}{"0F0}%
\am@DeclareMathSymbol\amarabletter{}{z}{\mathalpha}{amletters}{"50}%
\am@DeclareMathSymbol\amarabletter{}{T}{\mathalpha}{amletters}{"0A0}%
\am@DeclareMathSymbol\amarabletter{}{y}{\mathalpha}{amletters}{"0F8}%
\am@DeclareMathSymbol\amarabletter{}{k}{\mathalpha}{amletters}{"0B8}%
\am@DeclareMathSymbol\amarabletter{}{l}{\mathalpha}{amletters}{"0C8}%
\am@DeclareMathSymbol\amarabletter{}{m}{\mathalpha}{amletters}{"0D0}%
\am@DeclareMathSymbol\amarabletter{}{n}{\mathalpha}{amletters}{"0E0}%
\am@DeclareMathSymbol\amarabletter{}{c}{\mathalpha}{amletters}{"80}%
\am@DeclareMathSymbol\amarabletter{}{e}{\mathalpha}{amletters}{"0A8}%
\am@DeclareMathSymbol\amarabletter{}{f}{\mathalpha}{amletters}{"0AC}%
\am@DeclareMathSymbol\amarabletter{}{q}{\mathalpha}{amletters}{"86}%
\am@DeclareMathSymbol\amarabletter{}{s}{\mathalpha}{amletters}{"90}%
\am@DeclareMathSymbol\amarabletter{}{X}{\mathalpha}{amletters}{"42}%
\am@DeclareMathSymbol\amarabletter{}{A}{\mathalpha}{amletters}{"5A}%
\am@DeclareMathSymbol\amarabletter{}{Y}{\mathalpha}{amletters}{"0FE}%
\am@DeclareMathSymbol\amarabletter{}{N}{\mathalpha}{amletters}{"0DE}%
\am@DeclareMathSymbol\amarabletter{}{B}{\mathalpha}{amletters}{"4B}%
\am@DeclareMathSymbol\amarabletter{}{J}{\mathalpha}{amletters}{"6B}%
\am@DeclareMathSymbol\amarabletter{}{H}{\mathalpha}{amletters}{"0EB}%
\am@DeclareMathSymbol\amarabletter{}{L}{\mathalpha}{amletters}{"0CD}%
\am@DeclareMathSymbol\amarabletter{}{M}{\mathalpha}{amletters}{"0D3}%
\am@DeclareMathSymbol\amarabletter{}{C}{\mathalpha}{amletters}{"83}%
\am@DeclareMathSymbol\amarabletter{}{E}{\mathalpha}{amletters}{"0AB}%
\am@DeclareMathSymbol\amarabletter{}{F}{\mathalpha}{amletters}{"0AF}%
\am@DeclareMathSymbol\amarabletter{}{S}{\mathalpha}{amletters}{"93}%

% Arabic punctuation : \amarabpunct-amletters
\def\amarabpunct{}
\am@DeclareMathSymbol\amarabpunct{}{,}\mathrel{amletters}{"2C}%
\am@DeclareMathSymbol\amarabpunct{}{.}\mathord{amletters}{"2E}%
\am@DeclareMathSymbol\amarabpunct{}{;}\mathpunct{amletters}{"3B}%
\am@DeclareMathSymbol\amarabpunct{}{:}\mathpunct{amletters}{"3A}%
\am@DeclareMathSymbol\amarabpunct{}{!}\mathopen{amletters}{"21}%
\am@DeclareMathSymbol\amarabpunct{}{?}\mathopen{amletters}{"3F}

% Redéfinition de \hrulefill
\def\amhrulefill{\cleaders\hbox{${{\ammath\mkern-1mu%
 \hbox{\araby{-}}\mkern-1mu}}$}\hfill}


\endinput
