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


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

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


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


\DeclareRobustCommand\ammathpalette[1]{#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}{"3C}%
\am@DeclareMathSymbol\amarabletter{}{b}{\mathalpha}{amletters}{"E0}%
\am@DeclareMathSymbol\amarabletter{}{j}{\mathalpha}{amletters}{"82}%
\am@DeclareMathSymbol\amarabletter{}{d}{\mathalpha}{amletters}{"8A}%
\am@DeclareMathSymbol\amarabletter{}{w}{\mathalpha}{amletters}{"D7}%
\am@DeclareMathSymbol\amarabletter{}{z}{\mathalpha}{amletters}{"8E}%
\am@DeclareMathSymbol\amarabletter{}{T}{\mathalpha}{amletters}{"A2}%
\am@DeclareMathSymbol\amarabletter{}{y}{\mathalpha}{amletters}{"D9}%
\am@DeclareMathSymbol\amarabletter{}{k}{\mathalpha}{amletters}{"BB}%
\am@DeclareMathSymbol\amarabletter{}{l}{\mathalpha}{amletters}{"BE}%
\am@DeclareMathSymbol\amarabletter{}{m}{\mathalpha}{amletters}{"CA}%
\am@DeclareMathSymbol\amarabletter{}{n}{\mathalpha}{amletters}{"E4}%
\am@DeclareMathSymbol\amarabletter{}{c}{\mathalpha}{amletters}{"92}%
\am@DeclareMathSymbol\amarabletter{}{e}{\mathalpha}{amletters}{"AA}%
\am@DeclareMathSymbol\amarabletter{}{f}{\mathalpha}{amletters}{"E6}%
\am@DeclareMathSymbol\amarabletter{}{q}{\mathalpha}{amletters}{"EA}%
\am@DeclareMathSymbol\amarabletter{}{s}{\mathalpha}{amletters}{"9A}%
\am@DeclareMathSymbol\amarabletter{}{X}{\mathalpha}{amletters}{"C8}%
\am@DeclareMathSymbol\amarabletter{}{A}{\mathalpha}{amletters}{"60}%
%am@DeclareMathSymbol\amarabletter{}{Y}{\mathalpha}{amletters}{"FE}%
%am@DeclareMathSymbol\amarabletter{}{N}{\mathalpha}{amletters}{"DE}%
\am@DeclareMathSymbol\amarabletter{}{B}{\mathalpha}{amletters}{"E1}%
\am@DeclareMathSymbol\amarabletter{}{J}{\mathalpha}{amletters}{"83}%
\am@DeclareMathSymbol\amarabletter{}{H}{\mathalpha}{amletters}{"D3}%
\am@DeclareMathSymbol\amarabletter{}{L}{\mathalpha}{amletters}{"BF}%
\am@DeclareMathSymbol\amarabletter{}{M}{\mathalpha}{amletters}{"CB}%
\am@DeclareMathSymbol\amarabletter{}{C}{\mathalpha}{amletters}{"93}%
\am@DeclareMathSymbol\amarabletter{}{E}{\mathalpha}{amletters}{"AB}%
\am@DeclareMathSymbol\amarabletter{}{F}{\mathalpha}{amletters}{"E7}%
\am@DeclareMathSymbol\amarabletter{}{S}{\mathalpha}{amletters}{"9B}%

% Arabic punctuation : \amarabpunct-amletters
\def\amarabpunct{}
\am@DeclareMathSymbol\amarabpunct{}{,}\mathrel{amletters}{"21}%
\am@DeclareMathSymbol\amarabpunct{}{.}\mathord{amletters}{"24}%
\am@DeclareMathSymbol\amarabpunct{}{;}\mathpunct{amletters}{"22}%
%\am@DeclareMathSymbol\amarabpunct{}{:}\mathpunct{amletters}{"3A}%
%\am@DeclareMathSymbol\amarabpunct{}{!}\mathopen{amletters}{"21}%
\am@DeclareMathSymbol\amarabpunct{}{?}\mathopen{amletters}{"23}


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


\endinput
