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


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

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


%
\DeclareRobustCommand\ammathpalette[1]{%
 {\mathchoice
 {\usefont{U}{amramzarab}{m}{n}\fontsize{14}\f@baselineskip
 \selectfont{#1}}%
 {\usefont{U}{amramzarab}{m}{n}\fontsize{12}\f@baselineskip
 \selectfont{#1}}%
 {\usefont{U}{amramzarab}{m}{n}\fontsize{10}\f@baselineskip
 \selectfont{#1}}%
 {\usefont{U}{amramzarab}{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}{0}%
\am@DeclareMathSymbol\amarabletter{}{b}{\mathalpha}{amletters}{1}%
\am@DeclareMathSymbol\amarabletter{}{j}{\mathalpha}{amletters}{2}%
\am@DeclareMathSymbol\amarabletter{}{d}{\mathalpha}{amletters}{3}%
\am@DeclareMathSymbol\amarabletter{}{o}{\mathalpha}{amletters}{4}%
\am@DeclareMathSymbol\amarabletter{}{w}{\mathalpha}{amletters}{5}%
\am@DeclareMathSymbol\amarabletter{}{z}{\mathalpha}{amletters}{6}%
\am@DeclareMathSymbol\amarabletter{}{h}{\mathalpha}{amletters}{7}%
\am@DeclareMathSymbol\amarabletter{}{T}{\mathalpha}{amletters}{8}%
\am@DeclareMathSymbol\amarabletter{}{y}{\mathalpha}{amletters}{9}%
\am@DeclareMathSymbol\amarabletter{}{k}{\mathalpha}{amletters}{10}%
\am@DeclareMathSymbol\amarabletter{}{l}{\mathalpha}{amletters}{11}%
\am@DeclareMathSymbol\amarabletter{}{m}{\mathalpha}{amletters}{12}%
\am@DeclareMathSymbol\amarabletter{}{n}{\mathalpha}{amletters}{13}%
\am@DeclareMathSymbol\amarabletter{}{c}{\mathalpha}{amletters}{20}%
\am@DeclareMathSymbol\amarabletter{}{e}{\mathalpha}{amletters}{15}%
\am@DeclareMathSymbol\amarabletter{}{f}{\mathalpha}{amletters}{16}%
\am@DeclareMathSymbol\amarabletter{}{s}{\mathalpha}{amletters}{17}%
\am@DeclareMathSymbol\amarabletter{}{q}{\mathalpha}{amletters}{18}%
\am@DeclareMathSymbol\amarabletter{}{r}{\mathalpha}{amletters}{19}%
\am@DeclareMathSymbol\amarabletter{}{t}{\mathalpha}{amletters}{21}%
\am@DeclareMathSymbol\amarabletter{}{x}{\mathalpha}{amletters}{23}%
\am@DeclareMathSymbol\amarabletter{}{v}{\mathalpha}{amletters}{26}%
\am@DeclareMathSymbol\amarabletter{}{g}{\mathalpha}{amletters}{27}%

\am@DeclareMathSymbol\amarabletter{}{i}{\mathalpha}{amletters}{128}%
\am@DeclareMathSymbol\amarabletter{}{p}{\mathalpha}{amletters}{24}%
\am@DeclareMathSymbol\amarabletter{}{u}{\mathalpha}{amletters}{153}%

\am@DeclareMathSymbol\amarabletter{}{A}{\mathalpha}{amletters}{144}%
\am@DeclareMathSymbol\amarabletter{}{D}{\mathalpha}{amletters}{146}%
\am@DeclareMathSymbol\amarabletter{}{W}{\mathalpha}{amletters}{14}%
\am@DeclareMathSymbol\amarabletter{}{Z}{\mathalpha}{amletters}{148}%
\am@DeclareMathSymbol\amarabletter{}{R}{\mathalpha}{amletters}{157}%

\am@DeclareMathSymbol\amarabletter{}{I}{\mathalpha}{amletters}{149}%
\am@DeclareMathSymbol\amarabletter{}{P}{\mathalpha}{amletters}{25}%
\am@DeclareMathSymbol\amarabletter{}{U}{\mathalpha}{amletters}{152}%

\am@DeclareMathSymbol\amarabletter{}{B}{\mathalpha}{amletters}{145}%
\am@DeclareMathSymbol\amarabletter{}{J}{\mathalpha}{amletters}{29}%
\am@DeclareMathSymbol\amarabletter{}{O}{\mathalpha}{amletters}{147}%
\am@DeclareMathSymbol\amarabletter{}{H}{\mathalpha}{amletters}{31}%
\am@DeclareMathSymbol\amarabletter{}{Y}{\mathalpha}{amletters}{33}%
\am@DeclareMathSymbol\amarabletter{}{K}{\mathalpha}{amletters}{151}%
\am@DeclareMathSymbol\amarabletter{}{L}{\mathalpha}{amletters}{187}%
\am@DeclareMathSymbol\amarabletter{}{M}{\mathalpha}{amletters}{154}%
\am@DeclareMathSymbol\amarabletter{}{N}{\mathalpha}{amletters}{158}%
\am@DeclareMathSymbol\amarabletter{}{C}{\mathalpha}{amletters}{43}%
\am@DeclareMathSymbol\amarabletter{}{E}{\mathalpha}{amletters}{39}%
\am@DeclareMathSymbol\amarabletter{}{S}{\mathalpha}{amletters}{176}%
\am@DeclareMathSymbol\amarabletter{}{Q}{\mathalpha}{amletters}{131}%
\am@DeclareMathSymbol\amarabletter{}{t}{\mathalpha}{amletters}{21}%
\am@DeclareMathSymbol\amarabletter{}{F}{\mathalpha}{amletters}{22}%
\am@DeclareMathSymbol\amarabletter{}{X}{\mathalpha}{amletters}{178}%
\am@DeclareMathSymbol\amarabletter{}{V}{\mathalpha}{amletters}{180}%
\am@DeclareMathSymbol\amarabletter{}{G}{\mathalpha}{amletters}{182}%

% Arabic punctuation : \amarabpunct-amletters
\def\amarabpunct{}
\am@DeclareMathSymbol\amarabpunct{}{,}\mathrel{amletters}{251}%
\am@DeclareMathSymbol\amarabpunct{}{.}\mathord{amletters}{192}%
\am@DeclareMathSymbol\amarabpunct{}{;}\mathpunct{amletters}{255}%
\am@DeclareMathSymbol\amarabpunct{}{:}\mathpunct{amletters}{196}%
\am@DeclareMathSymbol\amarabpunct{}{!}\mathopen{amletters}{192}%
\am@DeclareMathSymbol\amarabpunct{}{?}\mathopen{amletters}{191}%


\endinput
