diff options
author | Karl Berry <karl@freefriends.org> | 2019-10-28 20:58:49 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-10-28 20:58:49 +0000 |
commit | ffd652038baef26fb84de26fce9991a02e875485 (patch) | |
tree | c02e3f8fde2e20bb8ba3cc9ab3216e609648e350 /Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf | |
parent | cffa8e2910c5d2a7b6b26032eef37d9e18b8b72d (diff) |
polyglossia (28oct19)
git-svn-id: svn://tug.org/texlive/trunk@52555 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf')
-rw-r--r-- | Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf | 129 |
1 files changed, 20 insertions, 109 deletions
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf index f9149badf6e..0c65b37574f 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf @@ -1,131 +1,42 @@ \ProvidesFile{gloss-farsi.ldf}[polyglossia: module for farsi] -\ifluatex - \xpg@warning{Farsi is not supported with LuaTeX.\MessageBreak -I will proceed with the compilation, but\MessageBreak -the output is not guaranteed to be correct\MessageBreak -and may look very wrong.} -\fi -\RequireBidi -\RequirePackage{arabicnumbers} -\RequirePackage{farsical} -\RequirePackage{hijrical} + +% We only provide this gloss for babel compatibility. +% The proper English language name is Persian. + +\input{gloss-persian.ldf} + \PolyglossiaSetup{farsi}{ script=Arabic, direction=RL, scripttag=arab, langtag=FAR, hyphennames={nohyphenation}, - fontsetup=true + fontsetup=true, + localnumeral=farsinumerals } -\newif\if@western@numerals -\def\tmp@western{western} \define@key{farsi}{numerals}[eastern]{% - \def\@tmpa{#1}% - \ifx\@tmpa\tmp@western\@western@numeralstrue\else% - \@western@numeralsfalse% - \fi} + \setkeys{persian}{numerals=#1}} -%this is needed for \abjad in arabicnumbers.sty -\def\tmp@true{true} \define@key{farsi}{abjadjimnotail}[true]{% - \def\@tmpa{#1}% - \ifx\@tmpa\tmp@true\abjad@jim@notailtrue% - \else - \abjad@jim@notailfalse - \fi} + \setkeys{persian}{abjadjimnotail=#1}} -% NOT YET USED \define@key{farsi}{locale}[default]{% - \def\@farsi@locale{#1}} - -%TODO add option for CALENDAR + \setkeys{persian}{locale=#1}} \setkeys{farsi}{locale,numerals} -\def\farsigregmonth#1{\ifcase#1% - \or ژانویه\or فوریه\or مارس\or آوریل\or مه\or ژوئن\or ژوئیه\or اوت\or سپتامبر\or اکتبر\or نوامبر\or دسامبر\fi} -\def\farsimonth#1{\ifcase#1% - \or کانون ثانی\or شباط\or اذار%%or ادار - \or نیسان\or ایار\or حزیران\or تموز\or آب\or ایلول\or تشرین اول\or تشرین ثانی\or کانون اول\fi} - %\Hijritoday is now locale-aware and will format the date with this macro: \DefineFormatHijriDate{farsi}{\@ensure@RTL{% -\farsinumber{\value{Hijriday}}\space\HijriMonthArabic{\value{Hijrimonth}}\space\farsinumber{\value{Hijriyear}}}} - -\def\captionsfarsi{% -\def\prefacename{\@ensure@RTL{پیشگفتار}}% -\def\refname{\@ensure@RTL{مراجع}}% -\def\abstractname{\@ensure@RTL{چکیده}}% -\def\bibname{\@ensure@RTL{کتابنامه}}% -\def\chaptername{\@ensure@RTL{فصل}}% -\def\appendixname{\@ensure@RTL{پیوست}}% -\def\contentsname{\@ensure@RTL{فهرست مطالب}}% -\def\listfigurename{\@ensure@RTL{لیست تصاویر}}% -\def\listtablename{\@ensure@RTL{لیست جداول}}% -\def\indexname{\@ensure@RTL{نمایه}}% -\def\figurename{\@ensure@RTL{شكل}}% -\def\tablename{\@ensure@RTL{جدول}}% -\def\partname{\@ensure@RTL{بخش}}% -\def\enclname{\@ensure@RTL{پیوست}}% -\def\ccname{\@ensure@RTL{رونوشت}}% -\def\headtoname{\@ensure@RTL{به}}% -\def\pagename{\@ensure@RTL{صفحة}}% -\def\seename{\@ensure@RTL{ببینید}}% -\def\alsoname{\@ensure@RTL{نیز ببینید}}% -\def\proofname{\@ensure@RTL{برهان}}% -\def\glossaryname{\@ensure@RTL{دانشنامه}}% -} -\def\datefarsi{% - \def\today{\@ensure@RTL{\farsinumber\day\space\farsigregmonth{\month}\space\farsinumber\year}}% -} - -\def\farsinumber#1{% - \if@western@numerals - \number#1% - \else - \ifnum\XeTeXcharglyph"06F0 > 0% - \farsidigits{\number#1}% - %%{\protect\addfontfeature{Mapping=farsidigits}\number#1}% - \else% - \arabicdigits{\number#1}% - %%{\protect\addfontfeature{Mapping=arabicdigits}\number#1}% - \fi - \fi} - -%\def\farsinum#1{\expandafter\farsinumber\csname c@#1\endcsname} -%\def\farsibracenum#1{(\expandafter\farsinumber\csname c@#1\endcsname)} -%\def\farsiornatebracenum#1{\char"FD3E\expandafter\farsinumber\csname c@#1\endcsname\char"FD3F} -%\def\farsialph#1{\expandafter\@farsialph\csname c@#1\endcsname} - -\def\farsi@numbers{% - \let\@latinalph\@alph% - \let\@latinAlph\@Alph% - \let\@alph\abjad% - \let\@Alph\abjad% -} -\def\nofarsi@numbers{% - \let\@alph\@latinalph% - \let\@Alph\@latinAlph% - } - -\def\farsi@globalnumbers{% - \let\orig@arabic\@arabic% - \let\@arabic\farsinumber% - % For some reason \thefootnote needs to be set separately: - \renewcommand\thefootnote{\protect\farsinumber{\c@footnote}}% - } + \farsinumber{\value{Hijriday}}\space\HijriMonthArabic{\value{Hijrimonth}}\space\farsinumber{\value{Hijriyear}}}} -\def\nofarsi@globalnumbers{ - \let\@arabic\orig@arabic% - \renewcommand\thefootnote{\protect\number{\c@footnote}}% - } +\let\captionsfarsi\captionspersian +\let\datefarsi\datepersian +\let\farsi@numbers\persian@numbers +\let\nofarsi@numbers\nopersian@numbers +\let\farsi@globalnumbers\persian@globalnumbers +\let\nofarsi@globalnumbers\nopersian@globalnumbers +\let\blockextras@farsi\blockextras@persian +\let\noextras@farsi\noextras@persian -\def\blockextras@farsi{% - \let\@@MakeUppercase\MakeUppercase% - \def\MakeUppercase##1{##1}% - } -\def\noextras@farsi{% - \let\MakeUppercase\@@MakeUppercase% - } \endinput |