diff options
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/polyglossia/gloss-syriac.ldf')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/polyglossia/gloss-syriac.ldf | 87 |
1 files changed, 45 insertions, 42 deletions
diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-syriac.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-syriac.ldf index ec808b5b8f2..e4bc22a8404 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-syriac.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-syriac.ldf @@ -1,5 +1,6 @@ \ProvidesFile{gloss-syriac.ldf}[polyglossia: module for syriac] -\RequirePackage{bidi}[0.3] +\RequirePackage{bidi} +\RequirePackage{arabicnumbers} \makeatletter \ifx\l@syriac\@undefined @@ -16,30 +17,30 @@ \def\tmp@abjad{abjad} \define@key{syriac}{numerals}[western]{% \def\@tmpa{#1}% - \ifx\@tmpa\tmp@abjad% - \let\syriacnumber\abjadsyriac% - \else% - \ifx\@tmpa\tmp@eastern% - \@eastern@numeralstrue% - \else% - \@eastern@numeralsfalse% - \fi% - \fi} + \ifx\@tmpa\tmp@abjad + \let\syriacnumber\abjadsyriac + \else + \ifx\@tmpa\tmp@eastern + \@eastern@numeralstrue + \else + \@eastern@numeralsfalse + \fi + \fi} \setkeys{syriac}{numerals} \def\syriac@font{% \@ifundefined{syriacfont}{% + \normalfontlatin% \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt \zf@check@ot@script{syrc}% - \if@tempswa% + \if@tempswa \addfontfeature{Script=Syriac}% - \else% + \else \PackageError{polyglossia}{^^J - The current font does not contain the Syriac script!^^J - Please define \string\syriacfont\space with \string\newfontfamily}% - \fi% - }% + The current font does not contain the Syriac script!^^J + Please define \string\syriacfont\space with \string\newfontfamily}% + \fi}% {\syriacfont}% } @@ -110,51 +111,44 @@ } \def\abj@syr@num@i#1{% \ifcase#1\or\char"0710\or\char"0712\or\char"0713\or\char"0715% - \or\char"0717\or\char"0718\or\char"0719\or\char"071A\or\char"071B\fi% + \or\char"0717\or\char"0718\or\char"0719\or\char"071A\or\char"071B\fi \ifnum#1=\z@\syriac@zero\fi} \def\abj@syr@num@ii#1{% \ifcase#1\or\char"071D\or\char"071F\or\char"0720\or\char"0721\or\char"0722% - \or\char"0723\or\char"0725\or\char"0726\or\char"0728\fi% + \or\char"0723\or\char"0725\or\char"0726\or\char"0728\fi \ifnum#1=\z@\fi\abj@syr@num@i} \def\abj@syr@num@iii#1{% \ifcase#1\or\char"0729\or\char"072A\or\char"072B\or\char"072C% \or\char"0722\char"0307\or\char"0723\char"0307\or\char"0725\char"0307% - \or\char"0726\char"0307\or\char"0728\char"0307\fi% + \or\char"0726\char"0307\or\char"0728\char"0307\fi \ifnum#1=\z@\fi\abj@syr@num@ii} \def\abj@syr@num@iv#1{% \ifcase#1\or\char"0710\char"0748\or\char"0712\char"0748% \or\char"0713\char"0748\or\char"0715\char"0748% \or\char"0717\char"0748\or\char"0718\char"0748% - \or\char"0719\char"0748\or\char"071A\char"0748\or\char"071B\char"0748\fi% + \or\char"0719\char"0748\or\char"071A\char"0748\or\char"071B\char"0748\fi \ifnum#1=\z@\fi\abj@syr@num@iii} \def\@syriacnumber#1{% - \if@eastern@numerals{% + \if@eastern@numerals \ifnum\XeTeXcharglyph"0661 > 0% - %%% we test for the presence of one of ١٢٣٤٥٦٧٨٩٠ in the Syriac font, - %%% else we try \arabicfont if defined (and give a warning), - %%% else we fall back to the Western numerals. - \protect\addfontfeature{Mapping=arabicdigits}\number#1}% + %%% we test for the presence of one of ١٢٣٤٥٦٧٨٩٠ in the Syriac font, + %%% else we try \arabicfont if defined (and give a warning), + %%% else we fall back to the Western numerals. + %%\protect\addfontfeature{Mapping=arabicdigits}\number#1}% + \protect\arabicdigits{\number#1}% \else% - \ifcsdef{arabicfont}% - {{\protect\arabicfont\protect\addfontfeature{Mapping=arabicdigits}% - \number#1}% - \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs: I am using \string\arabicfont instead}}% - {\RL{\reset@font\number#1}% - \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs: since \string\arabicfont is not defined, we'll use Western numerals instead}}% - \fi% - \else% - \RL{\reset@font\number#1}% + \ifcsdef{arabicfont}% + {\protect\arabicdigits{\number#1}% + \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs: I am using \string\arabicfont instead}}% + {\number#1%%% <---changed from \RL{\protect\reset@font\protect\number#1}% + \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs: since \string\arabicfont is not defined, we'll use Western numerals instead}}% + \fi + \else + %%\RL{\protect\reset@font\number#1}% + \number#1% \fi} -\def\syriac@globalnumbers{% - \let\@latinarabic\@arabic% - \let\@arabic\syriacnumber% - \renewcommand\thefootnote{\protect\syriacnumber{\c@footnote}}% - } -\def\nosyriac@globalnumbers{% - \let\@arabic\@latinarabic% - } \def\syriac@numbers{% \let\@latinalph\@alph% \let\@latinAlph\@Alph% @@ -165,6 +159,15 @@ \let\@alph\@latinalph% \let\@Alph\@latinAlph% } +\def\syriac@globalnumbers{% + \let\orig@arabic\@arabic% + \let\@arabic\syriacnumber% + \renewcommand\thefootnote{\protect\syriacnumber{\c@footnote}}% +} +\def\nosyriac@globalnumbers{% + \let\@arabic\orig@arabic% + \renewcommand\thefootnote{\protect\number{\c@footnote}}% + } \def\syriac@language{\language=\l@syriac} |