From 3e972ccc1affaed1d2183d610a38aac90478ffd7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 23 Mar 2010 22:56:28 +0000 Subject: polyglossia update (23mar10) git-svn-id: svn://tug.org/texlive/trunk@17538 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/xelatex/polyglossia/arabicnumbers.sty | 66 +++++ .../tex/xelatex/polyglossia/babel-hebrewalph.def | 79 ++++++ .../texmf-dist/tex/xelatex/polyglossia/babelsh.def | 15 +- .../tex/xelatex/polyglossia/farsical.sty | 17 +- .../tex/xelatex/polyglossia/gloss-albanian.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-amharic.ldf | 31 +-- .../tex/xelatex/polyglossia/gloss-arabic.ldf | 136 ++++------- .../tex/xelatex/polyglossia/gloss-asturian.ldf | 65 +++++ .../tex/xelatex/polyglossia/gloss-bahasai.ldf | 27 ++- .../tex/xelatex/polyglossia/gloss-bahasam.ldf | 15 +- .../tex/xelatex/polyglossia/gloss-basque.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-brazil.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-breton.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-bulgarian.ldf | 49 ++-- .../tex/xelatex/polyglossia/gloss-catalan.ldf | 94 +++++++- .../tex/xelatex/polyglossia/gloss-coptic.ldf | 28 +-- .../tex/xelatex/polyglossia/gloss-croatian.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-czech.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-danish.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-divehi.ldf | 29 +-- .../tex/xelatex/polyglossia/gloss-dutch.ldf | 42 +++- .../tex/xelatex/polyglossia/gloss-english.ldf | 3 +- .../tex/xelatex/polyglossia/gloss-esperanto.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-estonian.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-farsi.ldf | 158 ++++++------ .../tex/xelatex/polyglossia/gloss-finnish.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-french.ldf | 91 ++++--- .../tex/xelatex/polyglossia/gloss-galician.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-german.ldf | 184 +++++++------- .../tex/xelatex/polyglossia/gloss-greek.ldf | 1 + .../tex/xelatex/polyglossia/gloss-hebrew.ldf | 126 ++++------ .../tex/xelatex/polyglossia/gloss-hindi.ldf | 41 ++-- .../tex/xelatex/polyglossia/gloss-icelandic.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-irish.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-italian.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-latin.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-latvian.ldf | 4 +- .../tex/xelatex/polyglossia/gloss-lithuanian.ldf | 67 ++++++ .../tex/xelatex/polyglossia/gloss-lsorbian.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-magyar.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-norsk.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-nynorsk.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-polish.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-portuges.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-romanian.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-russian.ldf | 91 ++++--- .../tex/xelatex/polyglossia/gloss-samin.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-sanskrit.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-scottish.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-serbian.ldf | 61 ++--- .../tex/xelatex/polyglossia/gloss-slovak.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-slovenian.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-spanish.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-swedish.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-syriac.ldf | 87 +++---- .../tex/xelatex/polyglossia/gloss-thai.ldf | 47 +++- .../tex/xelatex/polyglossia/gloss-turkish.ldf | 6 + .../tex/xelatex/polyglossia/gloss-ukrainian.ldf | 52 ++-- .../tex/xelatex/polyglossia/gloss-urdu.ldf | 190 +++++++++++++++ .../tex/xelatex/polyglossia/gloss-usorbian.ldf | 2 +- .../tex/xelatex/polyglossia/gloss-welsh.ldf | 2 +- .../tex/xelatex/polyglossia/hijrical.sty | 28 ++- .../tex/xelatex/polyglossia/polyglossia.sty | 183 ++++++++------ .../xelatex/polyglossia/test-polyglossia-setup.aux | 37 +++ .../xelatex/polyglossia/test-polyglossia-setup.log | 268 +++++++++++++++++++++ .../xelatex/polyglossia/test-polyglossia-setup.pdf | Bin 0 -> 64706 bytes .../xelatex/polyglossia/test-polyglossia-setup.tex | 58 +++++ 67 files changed, 1760 insertions(+), 778 deletions(-) create mode 100644 Master/texmf-dist/tex/xelatex/polyglossia/arabicnumbers.sty create mode 100644 Master/texmf-dist/tex/xelatex/polyglossia/babel-hebrewalph.def create mode 100644 Master/texmf-dist/tex/xelatex/polyglossia/gloss-asturian.ldf create mode 100644 Master/texmf-dist/tex/xelatex/polyglossia/gloss-lithuanian.ldf create mode 100644 Master/texmf-dist/tex/xelatex/polyglossia/gloss-urdu.ldf create mode 100644 Master/texmf-dist/tex/xelatex/polyglossia/test-polyglossia-setup.aux create mode 100644 Master/texmf-dist/tex/xelatex/polyglossia/test-polyglossia-setup.log create mode 100644 Master/texmf-dist/tex/xelatex/polyglossia/test-polyglossia-setup.pdf create mode 100644 Master/texmf-dist/tex/xelatex/polyglossia/test-polyglossia-setup.tex (limited to 'Master/texmf-dist/tex/xelatex') diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/arabicnumbers.sty b/Master/texmf-dist/tex/xelatex/polyglossia/arabicnumbers.sty new file mode 100644 index 00000000000..c45aa22a654 --- /dev/null +++ b/Master/texmf-dist/tex/xelatex/polyglossia/arabicnumbers.sty @@ -0,0 +1,66 @@ +\ProvidesPackage{arabicnumbers} + [2010/03/18 v0.2 % + Formatting of Arabic and Farsi digits and of Arabic abjad numerals] + +\def\arabicdigits#1{\expandafter\@arabic@digits #1@} +\def\@arabic@digits#1{% + \ifx @#1% then terminate + \else + \ifx0#1٠\else\ifx1#1١\else\ifx2#1٢\else\ifx3#1٣\else\ifx4#1٤\else\ifx5#1٥\else\ifx6#1٦\else\ifx7#1٧\else\ifx8#1٨\else\ifx9#1٩\else#1\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \expandafter\@arabic@digits + \fi +} + +\def\farsidigits#1{\expandafter\@farsi@digits #1@} +\def\@farsi@digits#1{% + \ifx @#1% then terminate + \else + \ifx0#1۰\else\ifx1#1۱\else\ifx2#1۲\else\ifx3#1۳\else\ifx4#1۴\else\ifx5#1۵\else\ifx6#1۶\else\ifx7#1۷\else\ifx8#1۸\else\ifx9#1۹\else#1\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \expandafter\@farsi@digits + \fi +} + +\newif\ifabjad@jim@notail +\abjad@jim@notailfalse + +\def\abjad#1{% +\ifnum#1>1999\xpg@ill@value{#1}{abjad numeral}% +\else +\ifnum#1<\z@\space\xpg@ill@value{#1}{abjad numeral}% + \else + \ifnum#1<10\expandafter\abj@num@i@iso\number#1% + \else + \ifnum#1<100\expandafter\abj@num@ii\number#1% + \else + \ifnum#1<\@m\expandafter\abj@num@iii\number#1% + \else + \ifnum#1<\@M\expandafter\abj@num@iv\number#1%since #1<2000, we must have 1000 + \fi + \fi + \fi + \fi + \fi +\fi +} +\def\abjad@zero{} +\def\abjad@three{ج\ifabjad@jim@notail\char"200D\fi} +\def\abj@num@i@iso#1{% + \ifcase#1\or ا\or ب\or\abjad@three\or د% + \or ه\char"200D\or و\or ز\or ح\or ط\fi% + \ifnum#1=\z@\abjad@zero\fi} +\def\abj@num@i#1{% + \ifcase#1\or ا\or ب\or\abjad@three\or د% + \or ه\or و\or ز\or ح\or ط\fi% + \ifnum#1=\z@\abjad@zero\fi} +\def\abj@num@ii#1{% + \ifcase#1\or ي\or ك\or ل\or م\or ن% + \or س\or ع\or ف\or ص\fi% + \ifnum#1=\z@\fi\abj@num@i} +\def\abj@num@iii#1{% + \ifcase#1\or ق\or ر\or ش\or ت\or ث% + \or خ\or ذ\or ض\or ظ\fi% + \ifnum#1=\z@\fi\abj@num@ii} +\def\abj@num@iv#1{% + \ifcase#1\or غ\fi + \ifnum#1=\z@\fi\abj@num@iii} +\endinput diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/babel-hebrewalph.def b/Master/texmf-dist/tex/xelatex/polyglossia/babel-hebrewalph.def new file mode 100644 index 00000000000..568a17f52cf --- /dev/null +++ b/Master/texmf-dist/tex/xelatex/polyglossia/babel-hebrewalph.def @@ -0,0 +1,79 @@ +\ProvidesFile{babel-hebrewalph.def} + [2010/03/02 % + Babel definitions for Hebrew numerals^^J + Adapted from hebrew.ldf (2005/03/30 v2.3h)] +\newif\if@gim@apost % whether we print apostrophes (gereshayim) +\newif\if@gim@final % whether we use final or initial letters +\newcommand*{\hebrewnumeral}[1] % no apostrophe, no final letters + {{\@gim@finalfalse\@gim@apostfalse\@hebrew@numeral{#1}}} +\newcommand*{\Hebrewnumeral}[1] % apostrophe, no final letters + {{\@gim@finalfalse\@gim@aposttrue\@hebrew@numeral{#1}}} +\newcommand*{\Hebrewnumeralfinal}[1] % apostrophe, final letters + {{\@gim@finaltrue\@gim@aposttrue\@hebrew@numeral{#1}}} +\newcommand*{\@hebrew@numeral}[1]{% + \ifnum#1<\z@\space\xpg@warning{Illegal value (#1) for Hebrew numeral}% + \else + \@tempcnta=#1\@tempcntb=#1\relax + \divide\@tempcntb by 1000 + \ifnum\@tempcntb=0\gim@nomil\@tempcnta\relax + \else{\@gim@apostfalse\@gim@finalfalse\@hebrew@numeral\@tempcntb}׳% + \multiply\@tempcntb by 1000\relax + \advance\@tempcnta by -\@tempcntb\relax + \gim@nomil\@tempcnta\relax + \fi + \fi +} +\def\hebrew@alph@zero{} +\newcommand*{\gim@nomil}[1]{\@tempcnta=#1\@gim@prevfalse + \@tempcntb=\@tempcnta\divide\@tempcntb by 100\relax % hundreds digit + \ifcase\@tempcntb % print nothing if no hundreds + \or\gim@print{100}{ק}% + \or\gim@print{200}{ר}% + \or\gim@print{300}{ש}% + \or\gim@print{400}{ת}% + \or ת\@gim@prevtrue\gim@print{500}{ק}% + \or ת\@gim@prevtrue\gim@print{600}{ר}% + \or ת\@gim@prevtrue\gim@print{700}{ש}% + \or ת\@gim@prevtrue\gim@print{800}{ת}% + \or ת\@gim@prevtrue ת\gim@print{900}{ק}% + \fi + \@tempcntb=\@tempcnta\divide\@tempcntb by 10\relax % tens digit + \ifcase\@tempcntb % print nothing if no tens + \or % number between 10 and 19 + \ifnum\@tempcnta = 16 \gim@print {9}{ט}% tet-zayin + \else\ifnum\@tempcnta = 15 \gim@print {9}{ט}% tet-vav + \else \gim@print{10}{י}% + \fi % \@tempcnta = 15 + \fi % \@tempcnta = 16 + \or\gim@print{20}{\if@gim@final ך\else כ\fi}% + \or\gim@print{30}{ל}% + \or\gim@print{40}{\if@gim@final ם\else מ\fi}% + \or\gim@print{50}{\if@gim@final ן\else נ\fi}% + \or\gim@print{60}{ס}% + \or\gim@print{70}{ע}% + \or\gim@print{80}{\if@gim@final ף\else פ\fi}% + \or\gim@print{90}{\if@gim@final ץ\else צ\fi}% + \fi + \ifcase\@tempcnta + \hebrew@alph@zero% empty but can be defined if desired + \or\gim@print{1}{א}% + \or\gim@print{2}{ב}% + \or\gim@print{3}{ג}% + \or\gim@print{4}{ד}% + \or\gim@print{5}{ה}% + \or\gim@print{6}{ו}% + \or\gim@print{7}{ז}% + \or\gim@print{8}{ח}% + \or\gim@print{9}{ט}% + \fi +} +\newif\if@gim@prev % flag if a previous letter has been typeset +\newcommand*{\gim@print}[2]{% #2 is a letter, #1 is its value. + \advance\@tempcnta by -#1\relax% deduct the value from the remainder + \ifnum\@tempcnta=0% if this is the last letter + \if@gim@prev\if@gim@apost ״\fi#2% + \else#2\if@gim@apost ׳\fi\fi% + \else{\@gim@finalfalse#2}\@gim@prevtrue\fi} +\def\Alphfinal#1{\expandafter\@Alphfinal\csname c@#1\endcsname}% +\providecommand*{\@Alphfinal}[1]{\protect\Hebrewnumeralfinal{\number#1}} +\endinput diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/babelsh.def b/Master/texmf-dist/tex/xelatex/polyglossia/babelsh.def index 9bf1d1e46b7..5434f9be80d 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/babelsh.def +++ b/Master/texmf-dist/tex/xelatex/polyglossia/babelsh.def @@ -65,9 +65,10 @@ \fi}% \fi} \fi - \@ifpackagewith{babel}{KeepShorthandsActive}{}{% + %%\@ifpackagewith{babel}{KeepShorthandsActive}{}{% \edef\bbl@tempa{\catcode`\noexpand##1\the\catcode`##1}% - \expandafter\AtEndOfPackage\expandafter{\bbl@tempa}}% + \expandafter\AtEndOfPackage\expandafter{\bbl@tempa}% + %%}% \@tempcnta=\lccode`\~ \lccode`~=`##1% \lowercase{% @@ -237,7 +238,7 @@ \fi } \def\@notshorthand#1{% - \PackageError{babel}{% + \PackageError{polyglossia}{% The character `\string #1' should be made a shorthand character;\MessageBreak add the command \string\useshorthands\string{#1\string} to @@ -248,7 +249,7 @@ \newcommand*\shorthandoff[1]{\bbl@switch@sh{off}#1\@nil} \def\bbl@switch@sh#1#2#3\@nil{% \@ifundefined{active@char\string#2}{% - \PackageError{babel}{% + \PackageError{polyglossia}{% The character '\string #2' is not a shorthand character in \languagename}{% Maybe you made a typing mistake?\MessageBreak @@ -297,7 +298,11 @@ \bbl@activate{~} \def\bbl@disc#1#2{% \nobreak\discretionary{#2-}{}{#1}\allowhyphens} -%HERE ENDS THE CODE COPIED FROM babel.def -------------------- +\def\bbl@t@one{T1} +\def\allowhyphens{% + \ifx\cf@encoding\bbl@t@one\else\bbl@allowhyphens\fi} +\def\bbl@allowhyphens{\nobreak\hskip\z@skip} +%HERE ENDS THE CODE COPIED FROM babel.def -------------------- \def\bbl@disc@german#1#2{% \nobreak\discretionary{#2-}{}{#1}} \endinput diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/farsical.sty b/Master/texmf-dist/tex/xelatex/polyglossia/farsical.sty index 5e43ab75233..b78d29809c3 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/farsical.sty +++ b/Master/texmf-dist/tex/xelatex/polyglossia/farsical.sty @@ -1,7 +1,7 @@ \ProvidesPackage{farsical} [2008/07/02 v0.1 % Farsi (jalali) calendar] -\RequirePackage{bidi,calc} +\RequirePackage{bidi,calc,arabicnumbers} %TODO - rewrite completely using calc %% - use Reingold & Dershowitz ME @@ -184,17 +184,16 @@ \JALALI@d = \JALALI@dn \advance \JALALI@d by -\JALALI@sn \fi %% DATE FORMATTING -\if@RTL{\farsinumber\JALALI@d\space% -\Jalalimonth{\JALALI@m}\space\farsinumber\JALALI@y}% -\else% +\if@RTL{\farsidigits{\number\JALALI@d}\space% +\Jalalimonth{\JALALI@m}\space\farsidigits{\number\JALALI@y}}% +\else \number\JALALI@d\space\JalalimonthEnglish{\JALALI@m}% \space\number\JALALI@y% -\fi -} +\fi} %%% -\def\Jalalimonth#1{\ifcase#1\or فروردین\or -اردیبهشت\or خرداد\or تیر\or مرداد\or شهریور -\or مهر\or آبان\or آذر\or دی\or بهمن\or اسفند +\def\Jalalimonth#1{\ifcase#1\or فروردین\or +اردیبهشت\or خرداد\or تیر\or مرداد\or شهریور% +\or مهر\or آبان\or آذر\or دی\or بهمن\or اسفند% \fi} \def\JalalimonthEnglish#1{\ifcase#1% \or Farvardīn\or Ordībehesht\or Khordād\or Tīr diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-albanian.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-albanian.ldf index 4ce8ee077c6..f77b5ee0417 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-albanian.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-albanian.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-albanian.ldf}[polyglossia: module for albanian] \makeatletter -\def\albanian@font{\normalfontlatin} +\def\albanian@font{\selectfontfamilylatin} \ifx\l@albanian\@undefined \xpg@nopatterns{Albanian} diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-amharic.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-amharic.ldf index 48dcd85eeb0..a3939892f1d 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-amharic.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-amharic.ldf @@ -200,25 +200,26 @@ } \def\amharic@font{% -\font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt -\@ifundefined{amharicfont}{% + \@ifundefined{amharicfont}{% + \normalfontlatin% + \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt \@ifundefined{ethiopicfont}{% \zf@check@ot@script{ethi}% - \if@tempswa% - \addfontfeature{Script=Ethiopic}% - \else% - \PackageError{polyglossia}{^^J - The current font does not contain the Ethiopic script!^^J - Please define \string\ethiopicfont\space or \string\amharicfont\space with \string\newfontfamily}% - \fi% - \zf@check@ot@lang{AMH}% - \if@tempswa\addfontfeature{Language=Amharic}\fi% - }% + \if@tempswa + \addfontfeature{Script=Ethiopic}% + \else + \PackageError{polyglossia}{^^J + The current font does not contain the Ethiopic script!^^J + Please define \string\ethiopicfont\space or \string\amharicfont\space with \string\newfontfamily}% + \fi + \zf@check@ot@lang{AMH}% + \if@tempswa\addfontfeature{Language=Amharic}\fi + }% {\ethiopicfont% - \zf@check@ot@lang{AMH}% - \if@tempswa\addfontfeature{Language=Amharic}\fi% + \zf@check@ot@lang{AMH}% + \if@tempswa\addfontfeature{Language=Amharic}\fi }}% - {\amharicfont}% + {\amharicfont}% } \def\selectnormalfontamharic{% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-arabic.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-arabic.ldf index 7f4f4e35c80..71342bb9512 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-arabic.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-arabic.ldf @@ -1,5 +1,6 @@ \ProvidesFile{gloss-arabic.ldf}[polyglossia: module for arabic] -\RequirePackage{bidi}[0.3] +\RequirePackage{bidi} +\RequirePackage{arabicnumbers} \RequirePackage{hijrical} \makeatletter @@ -21,7 +22,7 @@ \ifx\@tmpa\tmp@maghrib\eastern@numeralsfalse\fi% \fi} -\newif\ifabjad@jim@notail +%this is needed for \abjad in arabicnumbers.sty \def\tmp@true{true} \define@key{arabic}{abjadjimnotail}[true]{% \def\@tmpa{#1}% @@ -83,6 +84,10 @@ {\xpg@warning{Option `locale=#1' is not defined for Arabic: using `default' instead}% \arabicgregmonth@default}} +%\Hijritoday is now locale-aware and will format the date with this macro: +\DefineFormatHijriDate{arabic}{\@ensure@RTL{% +\arabicnumber{\value{Hijriday}}\space\HijriMonthArabic{\value{Hijrimonth}}\space\arabicnumber{\value{Hijriyear}}}} + \def\captionsarabic{% \def\prefacename{\@ensure@RTL{مدخل}}% \def\refname{\@ensure@RTL{المراجع}} @@ -124,54 +129,17 @@ \fi}} -\def\arabicnumber#1{\ifeastern@numerals{\addfontfeature{Mapping=arabicdigits}\number#1}\else\RL{\reset@font\number#1}\fi} +\def\arabicnumber#1{% + \ifeastern@numerals + \arabicdigits{\number#1}% + \else + %%\RL{\protect\reset@font\number#1}% + \number#1% + \fi} \def\@ornatebracearabic#1{\RL{\char"FD3F\@arabic#1\char"FD3E}} \def\@ornatebracealph#1{\RL{\char"FD3F\@alph#1\char"FD3E}} -\ifcsdef{abjad}{}{% -\def\abjad#1{% -\ifnum#1>1999\xpg@ill@value{#1}{abjad numeral}% -\else% -\ifnum#1<\z@\space\xpg@ill@value{#1}{abjad numeral}% - \else% - \ifnum#1<10\expandafter\abj@num@i@iso\number#1% - \else% - \ifnum#1<100\expandafter\abj@num@ii\number#1% - \else% - \ifnum#1<\@m\expandafter\abj@num@iii\number#1% - \else% - \ifnum#1<\@M\expandafter\abj@num@iv\number#1%since #1<2000, we must have 1000 - \fi - \fi - \fi - \fi - \fi -\fi -} -\def\abjad@zero{} -\def\abjad@three{ج\ifabjad@jim@notail\char"200D\fi} -\def\abj@num@i@iso#1{% - \ifcase#1\or ا\or ب\or\abjad@three\or د% - \or ه\char"200D\or و\or ز\or ح\or ط\fi% - \ifnum#1=\z@\abjad@zero\fi} -\def\abj@num@i#1{% - \ifcase#1\or ا\or ب\or\abjad@three\or د% - \or ه\or و\or ز\or ح\or ط\fi% - \ifnum#1=\z@\abjad@zero\fi} -\def\abj@num@ii#1{% - \ifcase#1\or ي\or ك\or ل\or م\or ن% - \or س\or ع\or ف\or ص\fi% - \ifnum#1=\z@\fi\abj@num@i} -\def\abj@num@iii#1{% - \ifcase#1\or ق\or ر\or ش\or ت\or ث% - \or خ\or ذ\or ض\or ظ\fi% - \ifnum#1=\z@\fi\abj@num@ii} -\def\abj@num@iv#1{% - \ifcase#1\or غ\fi - \ifnum#1=\z@\fi\abj@num@iii} -} - \def\abjadmaghribi#1{% \ifnum#1>1999\xpg@ill@value{#1}{abjad}% \else @@ -192,7 +160,6 @@ \fi } - %maghribi س -> ص ص -> ض ش -> س ض -> ظ ظ -> غ غ -> ش \def\abj@maghribi@num@ii#1{% \ifcase#1\or ي\or ك\or ل\or م\or ن% @@ -207,90 +174,89 @@ \ifnum#1=\z@\fi\abj@maghribi@num@iii} \def\arabic@numbers{% - \let\@latinalph\@alph% - \let\@latinAlph\@Alph% + \let\@origalph\@alph% + \let\@origAlph\@Alph% \let\@alph\abjad% \let\@Alph\abjad% } \def\noarabic@numbers{% - \let\@alph\@latinalph% - \let\@Alph\@latinAlph% + \let\@alph\@origalph% + \let\@Alph\@origAlph% } \def\arabic@globalnumbers{% - \let\default@arabic\@arabic% - \let\@arabic\arabicnumber% - % For some reason these need to be set separately: - \renewcommand\thefootnote{\protect\arabicnumber{\c@footnote}}% - %%\ifcsundef{thechapter}{}{\renewcommand\thechapter{\protect\arabicnumber{\c@chapter}}}% <<<<<<<<<< - %%\ifcsundef{thesection}{}{\renewcommand\thesection{\protect\arabicnumber{\c@section}}}% <<<<<<<<<< - } + \let\orig@arabic\@arabic% + \let\@arabic\arabicnumber% + \renewcommand\thefootnote{\protect\arabicnumber{\c@footnote}}% + } \def\noarabic@globalnumbers{ - \let\@arabic\default@arabic% + \let\@arabic\orig@arabic% \renewcommand\thefootnote{\protect\number{\c@footnote}}% - %%\ifcsundef{thechapter}{}{\renewcommand\thechapter{\protect\number{\c@chapter}}}% <<<<<<<<<< - %%\ifcsundef{thesection}{}{\renewcommand\thesection{\protect\number{\c@section}}}% <<<<<<<<<< } \def\arabic@language{\language=\l@arabic} \def\arabic@font{% \@ifundefined{arabicfont}{% + \rmfamilylatin% \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt \zf@check@ot@script{arab}% - \if@tempswa% + \if@tempswa \addfontfeature{Script=Arabic}% - \else% + \else \PackageError{polyglossia}{^^J - The current font does not contain the Arabic script!^^J - Please define \string\arabicfont\space with \string\newfontfamily}% - \fi% - }% + The current font does not contain the Arabic script!^^J + Please define \string\arabicfont\space with \string\newfontfamily}% + \fi}% {\arabicfont}% } -% TODO add setup to define Sans and Mono Arabic fonts if desired \def\arabic@font@sf{% \@ifundefined{arabicfontsf}{% -% \sffamily% FIXME +% \sffamilylatin% % \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt -% \zf@check@ot@script{arab}% -% \if@tempswa% -% \addfontfeature{Script=Arabic}% -% \else% - \arabic@font% -% \fi% +% \zf@check@ot@script{arab}% +% \if@tempswa% +% \addfontfeature{Script=Arabic}% +% \else% + \arabic@font% +% \fi% }% {\arabicfontsf}% } \def\arabic@font@tt{% \@ifundefined{arabicfonttt}{% -% \ttfamily% FIXME +% \ttfamilylatin% % \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt -% \zf@check@ot@script{arab}% -% \if@tempswa% -% \addfontfeature{Script=Arabic}% -% \else% - \arabic@font% -% \fi% +% \zf@check@ot@script{arab}% +% \if@tempswa% +% \addfontfeature{Script=Arabic}% +% \else% + \arabic@font% +% \fi% }% {\arabicfonttt}% } \def\selectnormalfontarabic{% + %\edef\@tempa{\if\normalfont\sffamily\noexpand\arabic@font@sf\else + % \if\normalfont\ttfamily\noexpand\arabic@font@tt\else + % \noexpand\arabic@font\fi\fi}% \let\normalfont=\arabic@font% \let\rmfamily=\arabic@font% \let\sffamily=\arabic@font@sf% \let\ttfamily=\arabic@font@tt% - \def\reset@font{\normalfont}} + \def\reset@font{\normalfont}% + %\expand\@tempa% + } \def\blockextras@arabic{% - \let\@@MakeUppercase\MakeUppercase% + \let\orig@MakeUppercase\MakeUppercase% \def\MakeUppercase##1{##1}% % TODO disable \@Roman and \@roman ? } \def\noextras@arabic{% - \let\MakeUppercase\@@MakeUppercase% + \let\MakeUppercase\orig@MakeUppercase% } \endinput diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-asturian.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-asturian.ldf new file mode 100644 index 00000000000..64e80a042e3 --- /dev/null +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-asturian.ldf @@ -0,0 +1,65 @@ +% Translated by Xuacu +% Contributed by Kevin Godby +% +\ProvidesFile{gloss-asturian.ldf}[polyglossia: module for asturian] +\makeatletter +\def\asturian@font{\selectfontfamilylatin} + +\ifx\l@asturian\@undefined + \ifx\l@catalan\@undefined% + \xpg@nopatterns{asturian} + \adddialect\l@asturian\l@nohyphenation + \else + \xpg@warning{No hyphenation patterns were loaded for `asturian'\MessageBreak + I will use \string\language=\string\l@catalan\space instead} + \adddialect\l@asturian\l@catalan + \fi +\fi + +\def\captionsasturian{% + \def\prefacename{Entamu}% + \def\refname{Referencies}% + \def\abstractname{Sumariu}% + \def\bibname{Bibliografía}% + \def\chaptername{Capítulu}% + \def\appendixname{Apéndiz}% + \def\contentsname{Conteníu}% + \def\listfigurename{Llista de figures}% + \def\listtablename{Llista de tables}% + \def\indexname{Índiz}% + \def\figurename{Figura}% + \def\tablename{Tabla}% + \def\partname{Parte}% + \def\enclname{incl.}% + \def\ccname{cc}% + \def\headtoname{Pa}% + \def\pagename{Páxina}% + \def\seename{ver}% + \def\alsoname{ver tamién}% + \def\proofname{Demostración}% + \def\glossaryname{Glosariu}% + } +\def\dateasturian{% + \def\today{\number\day~\ifcase\month\or + de~xineru\or de~febreru\or de~marzu\or d'abril\or de~mayu\or de~xunu\or + de~xunetu\or d'agostu\or de~setiembre\or d'ochobre\or de~payares\or + d'avientu\fi\space de~\number\year}% +} + +\def\asturian@language{\language=\l@asturian} + +\setlocalhyphenmins{asturian}{2}{2}% + +\def\noextras@asturian{% + \nonfrenchspacing% +} + +\def\blockextras@asturian{% + \frenchspacing% +} + +\def\inlineextras@asturian{% + \frenchspacing% +} + +\endinput diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-bahasai.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-bahasai.ldf index 4c1bdd0ab0d..da185458156 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-bahasai.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-bahasai.ldf @@ -1,33 +1,34 @@ \ProvidesFile{gloss-bahasai.ldf}[polyglossia: module for bahasa indonesia] +\RequirePackage{hijrical} \makeatletter -\def\bahasai@font{\normalfontlatin} +\def\bahasai@font{\selectfontfamilylatin} -\ifx\l@bahasa\@undefined - \ifx\l@bahasai\@undefined +\ifx\l@bahasai\@undefined + \ifx\l@bahasa\@undefined \ifx\l@indon\@undefined \ifx\l@indonesian\@undefined \ifx\l@bahasam\@undefined \ifx\l@malay\@undefined \ifx\l@meyalu\@undefined \xpg@nopatterns{Bahasa Indonesia} - \adddialect\l@bahasa\l@nohyphenation\relax + \adddialect\l@bahasai\l@nohyphenation\relax \else - \let\l@bahasa\l@meyalu + \let\l@bahasai\l@meyalu \fi \else - \let\l@bahasa\l@malay + \let\l@bahasai\l@malay \fi \else - \let\l@bahasa\l@bahasam + \let\l@bahasai\l@bahasam \fi \else - \let\l@bahasa\l@indonesian + \let\l@bahasai\l@indonesian \fi \else - \let\l@bahasa\l@indon + \let\l@bahasai\l@indon \fi \else - \let\l@bahasa\l@bahasai + \let\l@bahasai\l@bahasa \fi \fi @@ -61,6 +62,12 @@ Juli\or Agustus\or September\or Oktober\or Nopember\or Desember\fi \space \number\year}} +\def\hijrimonthbahasai#1{\ifcase#1% +\or Muharram\or Safar\or Rabiul awal\or Rabiul akhir\or Jumadil awal\or Jumadil akhir\or Rajab% +\or Sya'ban\or Ramadhan\or Syawal\or Dzulkaidah\or Dzulhijjah\fi} +\DefineFormatHijriDate{bahasai}{% +\number\value{Hijriday}\space\hijrimonthbahasai{\value{Hijrimonth}}\space\number\value{Hijriyear}} + \def\bahasai@language{\language=\l@bahasai} \setlocalhyphenmins{bahasai}{2}{2} diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-bahasam.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-bahasam.ldf index 9cfb07f3422..678907a74ca 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-bahasam.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-bahasam.ldf @@ -1,6 +1,7 @@ -\ProvidesFile{gloss-bahasam.ldf}[polyglossia: module for bahasa malaysia] +\ProvidesFile{gloss-bahasam.ldf}[polyglossia: module for bahasa melayu] +\RequirePackage{hijrical} \makeatletter -\def\bahasam@font{\normalfontlatin} +\def\bahasam@font{\selectfontfamilylatin} \ifx\l@malay\@undefined \ifx\l@meyalu\@undefined @@ -9,7 +10,7 @@ \ifx\l@bahasai\@undefined \ifx\l@indon\@undefined \ifx\l@indonesian\@undefined - \xpg@nopatterns{Bahasa Malaysia} + \xpg@nopatterns{Bahasa Melayu}% \adddialect\l@malay\l@nohyphenation\relax \else \let\l@malay\l@indonesian @@ -61,7 +62,13 @@ Julai\or Ogos\or September\or Oktober\or November\or Disember\fi \space \number\year}} -\def\bahasam@language{\language=\l@bahasam} +\def\hijrimonthbahasam#1{\ifcase#1% +\or Muharram\or Safar\or Rabiulawal\or Rabiulakhir\or Jamadilawal\or Jamadilakhir\or Rejab% +\or Syaaban\or Ramadan\or Syawal\or Zulkaedah\or Zulhijah\fi} +\DefineFormatHijriDate{bahasam}{% +\number\value{Hijriday}\space\hijrimonthbahasam{\value{Hijrimonth}}\space\number\value{Hijriyear}} + +\def\bahasam@language{\language=\l@malay} \setlocalhyphenmins{bahasam}{2}{2} diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-basque.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-basque.ldf index 990d9a0df70..79bd0a0d6d6 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-basque.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-basque.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-basque.ldf}[polyglossia: module for basque] \makeatletter -\def\basque@font{\normalfontlatin} +\def\basque@font{\selectfontfamilylatin} \ifx\l@basque\@undefined% \xpg@nopatterns{Basque}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-brazil.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-brazil.ldf index e1e3d25349a..db169da6bbc 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-brazil.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-brazil.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-brazil.ldf}[polyglossia: module for portuguese] \makeatletter -\def\brazil@font{\normalfontlatin} +\def\brazil@font{\selectfontfamilylatin} %FIXME check this: \ifx\l@brazil\@undefined diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-breton.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-breton.ldf index c3ad0b7542d..9a7c507ce60 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-breton.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-breton.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-breton.ldf}[polyglossia: module for breton] \makeatletter -\def\breton@font{\normalfontlatin} +\def\breton@font{\selectfontfamilylatin} \ifx\l@breton\@undefined% \xpg@nopatterns{Breton}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-bulgarian.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-bulgarian.ldf index 5ce648ca0f6..5d7a8d9fc2d 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-bulgarian.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-bulgarian.ldf @@ -25,14 +25,14 @@ \xpg@ill@value{#1}{bulgarian@alph}\fi}% \def\bulgarian@numbers{% - \let\latin@Alph\@Alph% - \let\latin@alph\@alph% + \let\latin@Alph\@Alph% + \let\latin@alph\@alph% \let\@Alph\bulgarian@Alph% \let\@alph\bulgarian@alph% } \def\nobulgarian@numbers{% - \let\@Alph\latin@Alph% + \let\@Alph\latin@Alph% \let\@alph\latin@alph% } @@ -74,7 +74,7 @@ октомври\or ноември\or декември\fi% - \number\year~г.}% + \ \number\year~г.}% \def\month@Roman{\expandafter\@Roman\month}% \def\todayRoman{\number\day.\,\month@Roman.\,\number\year~г.}% } @@ -82,25 +82,28 @@ \def\bulgarian@language{\language=\l@bulgarian} \def\bulgarian@font{% -\font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt -\@ifundefined{bulgarianfont}{% - \@ifundefined{cyrillicfont}{% - \zf@check@ot@script{cyrl}% - \if@tempswa% - \addfontfeature{Script=Cyrillic}% - \else% - \PackageError{polyglossia}{^^J - The current font does not contain the Cyrillic script!^^J - Please define \string\cyrillicfont\space or \string\bulgarianfont\space with \string\newfontfamily}% - \fi% - \zf@check@ot@lang{BGR}% - \if@tempswa\addfontfeature{Language=Bulgarian}\fi - }% - {\cyrillicfont% - \zf@check@ot@lang{BGR}% - \if@tempswa\addfontfeature{Language=Bulgarian}\fi% - }}% -{\bulgarianfont}} + \@ifundefined{bulgarianfont}{% + \@ifundefined{cyrillicfont}{% + \normalfontlatin% + \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt + \zf@check@ot@script{cyrl}% + \if@tempswa + \addfontfeature{Script=Cyrillic}% + \else + \PackageError{polyglossia}{^^J + The current font does not contain the Cyrillic script!^^J + Please define \string\cyrillicfont\space or \string\bulgarianfont\space with \string\newfontfamily}% + \fi + \zf@check@ot@lang{BGR}% + \if@tempswa\addfontfeature{Language=Bulgarian}\fi + }% + {\cyrillicfont% + \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt + \zf@check@ot@lang{BGR}% + \if@tempswa\addfontfeature{Language=Bulgarian}\fi + }}% + {\bulgarianfont}% +} \setlocalhyphenmins{bulgarian}{2}{2}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-catalan.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-catalan.ldf index e89999a2846..acc0c27e759 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-catalan.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-catalan.ldf @@ -1,12 +1,88 @@ \ProvidesFile{gloss-catalan.ldf}[polyglossia: module for catalan] \makeatletter -\def\catalan@font{\normalfontlatin} +\def\catalan@font{\selectfontfamilylatin} \ifx\l@catalan\@undefined% \xpg@nopatterns{Catalan}% \adddialect\l@catalan\l@nohyphenation% \fi +\define@boolkey{catalan}[catalan@]{babelshorthands}[true]{} +\ifsystem@babelshorthands + \setkeys{catalan}{babelshorthands=true} +\else + \setkeys{catalan}{babelshorthands=false} +\fi +\ifcsundef{initiate@active@char}{% +\input{babelsh.def}% +\initiate@active@char{"}% +}{} + +%%% adapted from Babel's catalan.ldf +\newdimen\leftllkern \newdimen\rightllkern \newdimen\raiselldim +% we check if char · exists, and use it instead of raised dot: +\def\xpg@raiseddot{\ifnum\XeTeXcharglyph"00B7 > 0\hbox{\char"00B7}% + \else\raise\raiselldim\hbox{.}\fi} +\def\lgem{% + \ifmmode + \csname normal@char\string"\endcsname l% + \else + \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt% + \setbox0\hbox{l}\setbox1\hbox{l\/}% + \ifnum\XeTeXcharglyph"00B7 > 0\setbox2\hbox{\char"00B7}\else\setbox2\hbox{.}\fi + \advance\raiselldim by \the\fontdimen5\the\font + \advance\raiselldim by -\ht2% + \leftllkern=-.25\wd0% + \advance\leftllkern by \wd1% + \advance\leftllkern by -\wd0% + \rightllkern=-.25\wd0% + \advance\rightllkern by -\wd1% + \advance\rightllkern by \wd0% + \allowhyphens\discretionary{l-}{l}% + {\hbox{l}\kern\leftllkern\xpg@raiseddot% + \kern\rightllkern\hbox{l}}\allowhyphens + \fi +} +\def\Lgem{% + \ifmmode + \csname normal@char\string"\endcsname L% + \else + \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt% + \setbox0\hbox{L}\setbox1\hbox{L\/}% + \ifnum\XeTeXcharglyph"00B7 > 0\setbox2\hbox{\char"00B7}\else\setbox2\hbox{.}\fi + \advance\raiselldim by .5\ht0% + \advance\raiselldim by -.5\ht2% + \leftllkern=-.125\wd0% + \advance\leftllkern by \wd1% + \advance\leftllkern by -\wd0% + \rightllkern=-\wd0% + \divide\rightllkern by 6% + \advance\rightllkern by -\wd1% + \advance\rightllkern by \wd0% + \allowhyphens\discretionary{L-}{L}% + {\hbox{L}\kern\leftllkern\xpg@raiseddot% + \kern\rightllkern\hbox{L}}\allowhyphens + \fi +} +\AtBeginDocument{% + \let\lslash\l + \let\Lslash\L + \DeclareRobustCommand\l{\@ifnextchar.\bbl@l{\@ifnextchar·\bbl@l\lslash}} + \DeclareRobustCommand\L{\@ifnextchar.\bbl@L{\@ifnextchar·\bbl@L\Lslash}}} +\def\bbl@l#1#2{\lgem} +\def\bbl@L#1#2{\Lgem} + +\def\catalan@shorthands{% + \bbl@activate{"}% + \def\language@group{catalan}% + \declare@shorthand{catalan}{"l}{\lgem{}} + \declare@shorthand{catalan}{"L}{\Lgem{}} +} + +\def\nocatalan@shorthands{% + \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}% +} + \def\captionscatalan{% \def\refname{Referències}% \def\abstractname{Resum}% @@ -31,7 +107,7 @@ \def\proofname{Demostració}% \def\glossaryname{Glossari}% } -\datecatalan{% +\def\datecatalan{% \def\today{\number\day~\ifcase\month\or de gener\or de febrer\or de març\or d'abril\or de maig\or de juny\or de juliol\or d'agost\or de setembre\or d'octubre\or @@ -42,4 +118,18 @@ \setlocalhyphenmins{catalan}{2}{2} +\def\noextras@catalan{% + \nonfrenchspacing% + \nocatalan@shorthands% +} + +\def\blockextras@catalan{% + \frenchspacing% + \ifcatalan@babelshorthands\catalan@shorthands\fi% +} + +\def\inlineextras@catalan{% + \frenchspacing% + \ifcatalan@babelshorthands\catalan@shorthands\fi% +} \endinput diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-coptic.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-coptic.ldf index 62d68cdd799..b7432608fe3 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-coptic.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-coptic.ldf @@ -37,20 +37,20 @@ \def\coptic@language{\language=\l@coptic} \def\coptic@font{% -\font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt -\@ifundefined{copticfont}{% - \zf@check@ot@script{copt}% - \if@tempswa% - \addfontfeature{Script=Coptic}% - \zf@check@ot@lang{COP}% - \if@tempswa\addfontfeature{Language=Coptic}\fi% - \else% - \PackageError{polyglossia}{^^J - The current font does not contain the Coptic script!^^J - Please define \string\copticfont\space with \string\newfontfamily}% - \fi% - }% - {\copticfont}% + \@ifundefined{copticfont}{% + \normalfontlatin% + \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt + \zf@check@ot@script{copt}% + \if@tempswa + \addfontfeature{Script=Coptic}% + \zf@check@ot@lang{COP}% + \if@tempswa\addfontfeature{Language=Coptic}\fi + \else + \PackageError{polyglossia}{^^J + The current font does not contain the Coptic script!^^J + Please define \string\copticfont\space with \string\newfontfamily}% + \fi}% + {\copticfont}% } \def\selectnormalfontcoptic{% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-croatian.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-croatian.ldf index d578a225863..7aa548ee6e6 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-croatian.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-croatian.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-croatian.ldf}[polyglossia: module for croatian] \makeatletter -\def\croatian@font{\normalfontlatin} +\def\croatian@font{\selectfontfamilylatin} \ifx\l@croatian\@undefined% \xpg@nopatterns{Croatian}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-czech.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-czech.ldf index b7d19d1564c..a0556a180b5 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-czech.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-czech.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-czech.ldf}[polyglossia: module for czech] \makeatletter -\def\czech@font{\normalfontlatin} +\def\czech@font{\selectfontfamilylatin} \ifx\l@czech\@undefined% \xpg@nopatterns{Czech}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-danish.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-danish.ldf index 251a3ea8ceb..9808698580d 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-danish.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-danish.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-danish.ldf}[polyglossia: module for danish] \makeatletter -\def\danish@font{\normalfontlatin} +\def\danish@font{\selectfontfamilylatin} \ifx\l@danish\@undefined \xpg@nopatterns{Danish} diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-divehi.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-divehi.ldf index 17feea24196..e9baf9ca961 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-divehi.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-divehi.ldf @@ -38,20 +38,21 @@ \def\divehi@language{\language=\l@divehi} \def\divehi@font{% -\font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt -\@ifundefined{divehifont}{% - \@ifundefined{thaanafont}{% - \zf@check@ot@script{thaa}% - \if@tempswa% - \addfontfeature{Script=Thaana}% - \else% - \PackageError{polyglossia}{^^J - The current font does not contain the Thaana script!^^J - Please define \string\thaanafont\space or \string\divehifont\space with \string\newfontfamily}% - \fi% - }% - {\thaanafont}}% -{\divehifont}% + \@ifundefined{divehifont}{% + \@ifundefined{thaanafont}{% + \normalfontlatin% + \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt + \zf@check@ot@script{thaa}% + \if@tempswa + \addfontfeature{Script=Thaana}% + \else + \PackageError{polyglossia}{^^J + The current font does not contain the Thaana script!^^J + Please define \string\thaanafont\space or \string\divehifont\space with \string\newfontfamily}% + \fi + }% + {\thaanafont}}% + {\divehifont}% } \def\selectnormalfontdivehi{% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-dutch.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-dutch.ldf index dc0255b19da..b7f6e37650b 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-dutch.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-dutch.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-dutch.ldf}[polyglossia: module for dutch] \makeatletter -\def\dutch@font{\normalfontlatin} +\def\dutch@font{\selectfontfamilylatin} \ifx\l@dutch\@undefined \xpg@nopatterns{Dutch} @@ -15,6 +15,37 @@ \nonfrenchspacing% } +\define@boolkey{dutch}[dutch@]{babelshorthands}[true]{} + +\ifsystem@babelshorthands + \setkeys{dutch}{babelshorthands=true} +\else + \setkeys{dutch}{babelshorthands=false} +\fi + +\ifcsundef{initiate@active@char}{% +\input{babelsh.def}% +\initiate@active@char{"}% +}{} + +\def\dutch@shorthands{% + \bbl@activate{"}% + \def\language@group{dutch}% + \declare@shorthand{dutch}{"-}{\nobreak-\bbl@allowhyphens} + \declare@shorthand{dutch}{"~}{\textormath{\leavevmode\hbox{-}}{-}} + \declare@shorthand{dutch}{"|}{% + \textormath{\discretionary{-}{}{\kern.03em}}{}} + \declare@shorthand{dutch}{""}{\hskip\z@skip} + \declare@shorthand{dutch}{"/}{\textormath + {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}% + \def\-{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}% +} + +\def\nodutch@shorthands{% + \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}% + \def\-{\discretionary{-}{}{}}% << original def in latex.ltx +} + \def\captionsdutch{% \def\prefacename{Voorwoord}% \def\refname{Referenties}% @@ -48,15 +79,18 @@ \setlocalhyphenmins{dutch}{2}{2}% \def\noextras@dutch{% - \nodutch@punctuation% + \nodutch@punctuation% + \nodutch@shorthands% } \def\blockextras@dutch{% - \dutch@punctuation% + \dutch@punctuation% + \ifdutch@babelshorthands\dutch@shorthands\fi% } \def\inlineextras@dutch{% - \dutch@punctuation% + \dutch@punctuation% + \ifdutch@babelshorthands\dutch@shorthands\fi% } \endinput diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-english.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-english.ldf index 9556c270190..e541aa9e4a9 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-english.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-english.ldf @@ -1,6 +1,7 @@ \ProvidesFile{gloss-english.ldf}[polyglossia: module for english] \makeatletter -\def\english@font{\normalfontlatin} +%TODO change to \selectnormalfontlatin in all ldfs +\def\english@font{\selectfontfamilylatin} \ifx\l@english\@undefined% \ifx\l@USenglish\@undefined% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-esperanto.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-esperanto.ldf index eefa595232f..c95f6029e49 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-esperanto.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-esperanto.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-esperanto.ldf}[polyglossia: module for esperanto] \makeatletter -\def\esperanto@font{\normalfontlatin} +\def\esperanto@font{\selectfontfamilylatin} \ifx\l@esperanto\@undefined% \xpg@nopatterns{Esperanto}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-estonian.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-estonian.ldf index b88d49b66ea..daf6acf9f5f 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-estonian.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-estonian.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-estonian.ldf}[polyglossia: module for estonian] \makeatletter -\def\estonian@font{\normalfontlatin} +\def\estonian@font{\selectfontfamilylatin} \ifx\l@estonian\@undefined% \xpg@nopatterns{Estonian}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-farsi.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-farsi.ldf index 75556ea167b..6ef01edb1df 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-farsi.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-farsi.ldf @@ -1,6 +1,8 @@ \ProvidesFile{gloss-farsi.ldf}[polyglossia: module for farsi] \RequirePackage{bidi} +\RequirePackage{arabicnumbers} \RequirePackage{farsical} +\RequirePackage{hijrical} \makeatletter \ifx\l@farsi\@undefined @@ -13,27 +15,40 @@ \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} + \def\@tmpa{#1}% + \ifx\@tmpa\tmp@western\@western@numeralstrue\else% + \@western@numeralsfalse% + \fi} + +%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} -% NOT YET USED +% NOT YET USED \define@key{farsi}{locale}[default]{% - \def\@farsi@locale{#1}} + \def\@farsi@locale{#1}} %TODO add option for CALENDAR \setkeys{farsi}{locale,numerals} \def\farsigregmonth#1{\ifcase#1% - \or ژانویه\or فوریه\or مارس\or آوریل\or مه\or ژوئن\or ژوئیه؛\or ژویه\or اوت\or سپتامبر\or اکتبر\or نوامبر\or دسامبر\fi} + \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 آب\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\prefacename{\@ensure@RTL{پیشگفتار}}% \def\refname{\@ensure@RTL{مراجع}}% \def\abstractname{\@ensure@RTL{چکیده}}% \def\bibname{\@ensure@RTL{کتاب‌نامه}}% @@ -46,69 +61,37 @@ \def\figurename{\@ensure@RTL{شكل}}% \def\tablename{\@ensure@RTL{جدول}}% \def\partname{\@ensure@RTL{بخش}}% -%\def\enclname{\@ensure@RTL{}}%<-- Needs translation -%\def\ccname{\@ensure@RTL{}}%<-- Needs translation -%\def\headtoname{\@ensure@RTL{}}%<-- Needs translation +\def\enclname{\@ensure@RTL{پیوست}}% +\def\ccname{\@ensure@RTL{رونوشت}}% +\def\headtoname{\@ensure@RTL{به}}% \def\pagename{\@ensure@RTL{صفحة}}% -%\def\seename{\@ensure@RTL{}}%<-- Needs translation -%\def\alsoname{\@ensure@RTL{}}%<-- Needs translation +\def\seename{\@ensure@RTL{ببینید}}% +\def\alsoname{\@ensure@RTL{نیز ببینید}}% \def\proofname{\@ensure@RTL{برهان}}% -\def\glossaryname{\@ensure@RTL{لغت‌نامه}}%<-- Needs to be checked +\def\glossaryname{\@ensure@RTL{دانش‌نامه}}% } \def\datefarsi{% \def\today{\@ensure@RTL{\farsinumber\day\space\farsigregmonth{\month}\space\farsinumber\year}}% } -\def\farsinumber#1{\if@western@numerals\RL{\number#1}\else% -\ifnum\XeTeXcharglyph"06F0 > 0% -{\protect\addfontfeature{Mapping=farsidigits}\number#1}% -\else% -{\protect\addfontfeature{Mapping=arabicdigits}\number#1}% -\fi\fi} +\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} -\ifcsdef{abjad}{}{% -\def\abjad#1{% -\ifnum#1>1999 \xpg@warning{Illegal value (#1) for abjad numeral} {#1} -\else - \ifnum#1<\z@\space\xpg@warning{Illegal value (#1) for abjad numeral}% - \else - \ifnum#1<10\expandafter\abj@num@i\number#1% - \else - \ifnum#1<100\expandafter\abj@num@ii\number#1% - \else - \ifnum#1<\@m\expandafter\abj@num@iii\number#1% - \else - \ifnum#1<\@M\expandafter\abj@num@iv\number#1%since #1<2000, we must have 1000 - \fi - \fi - \fi - \fi - \fi -\fi -} -\def\abjad@zero{} -\def\abj@num@i#1{% - \ifcase#1\or ا\or ب\or ج\char"200D\or د% - \or ه\or و\or ز\or ح\or ط\fi - \ifnum#1=\z@\abjad@zero\fi} -\def\abj@num@ii#1{% - \ifcase#1\or ي\or ك\or ل\or م\or ن% - \or س\or ع\or ف\or ص\fi - \ifnum#1=\z@\fi\abj@num@i} -\def\abj@num@iii#1{% - \ifcase#1\or ق\or ر\or ش\or ت\or ث% - \or خ\or ذ\or ض\or ظ\fi - \ifnum#1=\z@\fi\abj@num@ii} -\def\abj@num@iv#1{% - \ifcase#1\or غ\fi - \ifnum#1=\z@\fi\abj@num@iii} -} - \def\farsi@numbers{% \let\@latinalph\@alph% \let\@latinAlph\@Alph% @@ -121,50 +104,53 @@ } \def\farsi@globalnumbers{% - \let\@latinarabic\@arabic% + \let\orig@arabic\@arabic% \let\@arabic\farsinumber% % For some reason \thefootnote needs to be set separately: \renewcommand\thefootnote{\protect\farsinumber{\c@footnote}}% } \def\nofarsi@globalnumbers{ - \let\@arabic\@latinarabic% + \let\@arabic\orig@arabic% \renewcommand\thefootnote{\protect\number{\c@footnote}}% } \def\farsi@language{\language=\l@farsi} \def\farsi@font{% -\font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt -\@ifundefined{farsifont}{% - \@ifundefined{arabicfont}{% - \zf@check@ot@script{arab}% - \if@tempswa% - \addfontfeature{Script=Arabic}% - \else% - \PackageError{polyglossia}{^^J - The current font does not contain the Arabic script!^^J - Please define \string\arabicfont\space or \string\farsifont\space with \newfontfamily}% - \fi% - \zf@check@ot@lang{FAR}% - \if@tempswa\addfontfeature{Language=Farsi}\fi - }% - {\arabicfont% - \zf@check@ot@lang{FAR}% - \if@tempswa\addfontfeature{Language=Farsi}\fi} - }% -{\farsifont}} + \@ifundefined{farsifont}{% + \@ifundefined{arabicfont}{% + \normalfontlatin% + \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt + \zf@check@ot@script{arab}% + \if@tempswa + \addfontfeature{Script=Arabic}% + \else + \PackageError{polyglossia}{^^J + The current font does not contain the Arabic script!^^J + Please define \string\arabicfont\space or \string\farsifont\space with \newfontfamily}% + \fi + \zf@check@ot@lang{FAR}% + \if@tempswa\addfontfeature{Language=Farsi}\fi}% + {\arabicfont% + \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt + \zf@check@ot@lang{FAR}% + \if@tempswa\addfontfeature{Language=Farsi}\fi}% + }% + {\farsifont}% +} + % TODO add setup to define Sans and Mono Arabic fonts if desired \def\farsi@font@sf{% \@ifundefined{farsifontsf}{% % \sffamily% FIXME % \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt % \zf@check@ot@script{arab}% -% \if@tempswa% +% \if@tempswa % \addfontfeature{Script=Arabic}% -% \else% +% \else \farsi@font% -% \fi% +% \fi }% {\farsifontsf}% } @@ -173,11 +159,11 @@ % \ttfamily% FIXME % \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt % \zf@check@ot@script{arab}% -% \if@tempswa% +% \if@tempswa % \addfontfeature{Script=Arabic}% -% \else% +% \else \farsi@font% -% \fi% +% \fi }% {\farsifonttt}% } diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-finnish.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-finnish.ldf index 60f4a5b971b..5da03045ae7 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-finnish.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-finnish.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-finnish.ldf}[polyglossia: module for finnish] \makeatletter -\def\finnish@font{\normalfontlatin} +\def\finnish@font{\selectfontfamilylatin} \ifx\l@finnish\@undefined% \xpg@nopatterns{Finnish}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-french.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-french.ldf index 01ad63a783a..9f5aef3c8a7 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-french.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-french.ldf @@ -1,18 +1,19 @@ \ProvidesFile{gloss-french.ldf}[polyglossia: module for french] \makeatletter -\def\french@font{\normalfontlatin} +\def\french@font{\selectfontfamilylatin} \ifx\l@french\@undefined% \xpg@nopatterns{French}% \adddialect\l@french\l@nohyphenation% \fi -\newXeTeXintercharclass\french@punctthin % ! ? ; +\newXeTeXintercharclass\french@punctthin % ! ? ; et autres \newXeTeXintercharclass\french@punctthick % : -\newXeTeXintercharclass\french@punctguill % « » +\newXeTeXintercharclass\french@punctguillstart % « ‹ +\newXeTeXintercharclass\french@punctguillend % » › -\def\french@punctthinspace{{\unskip\thinspace}} -\def\french@punctthickspace{{\unskip\nobreakspace}} +\def\xpg@unskip{\ifhmode\ifdim\lastskip>\z@\unskip\fi\fi} +\def\xpg@nospace#1{#1} \def\french@punctuation{% \frenchspacing @@ -20,31 +21,48 @@ \XeTeXinterchartokenstate=1 \XeTeXcharclass `\! \french@punctthin \XeTeXcharclass `\? \french@punctthin + \XeTeXcharclass `\‼ \french@punctthin + \XeTeXcharclass `\⁇ \french@punctthin + \XeTeXcharclass `\⁈ \french@punctthin + \XeTeXcharclass `\⁉ \french@punctthin \XeTeXcharclass `\; \french@punctthin \XeTeXcharclass `\: \french@punctthick - \XeTeXinterchartoks \z@ \french@punctthin = \french@punctthinspace - \XeTeXinterchartoks \z@ \french@punctthick = \french@punctthickspace + \XeTeXcharclass `\« \french@punctguillstart + \XeTeXcharclass `\» \french@punctguillend + \XeTeXcharclass `\‹ \french@punctguillstart + \XeTeXcharclass `\› \french@punctguillend + \XeTeXinterchartoks \z@ \french@punctthin = {\nobreak\thinspace}% + \XeTeXinterchartoks \z@ \french@punctthick = {\nobreakspace}% + \XeTeXinterchartoks 255 \french@punctthin = {\xpg@unskip\nobreak\thinspace}% + \XeTeXinterchartoks 255 \french@punctthick = {\xpg@unskip\nobreakspace}% + \XeTeXinterchartoks \french@punctguillstart \z@ = {\nobreakspace}% "«a" -> "« a" +% \XeTeXinterchartoks \z@ \french@punctguillstart = {\nobreakspace}% "a«" unchanged? +% \XeTeXinterchartoks \french@punctguillend \z@ = {\nobreakspace}% "»a" unchanged? + \XeTeXinterchartoks \z@ \french@punctguillend = {\nobreakspace}% "a»" -> "a »" + \XeTeXinterchartoks \french@punctguillstart 255 = {\nobreakspace\xpg@nospace}% "« " -> "«~" + \XeTeXinterchartoks 255 \french@punctguillend = {\xpg@unskip\nobreakspace}% " »" -> "~»" + \XeTeXinterchartoks \french@punctguillend \french@punctthin = {\nobreak\thinspace}% "»;" -> "» ;" + \XeTeXinterchartoks \french@punctguillend \french@punctthick = {\nobreakspace}% "»:" -> "» :" + \XeTeXinterchartoks \french@punctthin \french@punctguillend = {\nobreakspace}% "?»" -> "? »" } \def\nofrench@punctuation{% \nonfrenchspacing \lccode"2019=\z@ + \XeTeXcharclass `\! \z@ + \XeTeXcharclass `\? \z@ + \XeTeXcharclass `\‼ \z@ + \XeTeXcharclass `\⁇ \z@ + \XeTeXcharclass `\⁈ \z@ + \XeTeXcharclass `\⁉ \z@ + \XeTeXcharclass `\; \z@ + \XeTeXcharclass `\: \z@ + \XeTeXcharclass `\« \z@ + \XeTeXcharclass `\» \z@ + \XeTeXcharclass `\‹ \z@ + \XeTeXcharclass `\› \z@ \XeTeXinterchartokenstate=0 -} - -\def\french@guillemets{% - \XeTeXinterchartokenstate=1 - \XeTeXcharclass `\« \french@punctguill - \XeTeXcharclass `\» \french@punctguill - \XeTeXinterchartoks \french@punctguill \z@ = \french@punctthickspace - \XeTeXinterchartoks \z@ \french@punctguill = \french@punctthickspace - \XeTeXinterchartoks \french@punctguill \french@punctthin = \french@punctthinspace - % "»;" -> "» ;" - \XeTeXinterchartoks \french@punctguill \french@punctthick = \french@punctthickspace - % "»:" -> "» :" - \XeTeXinterchartoks \french@punctthin \french@punctguill = \french@punctthickspace - % "?»" -> "? »" -} + } \def\captionsfrench{% \def\refname{Références}% @@ -57,13 +75,13 @@ \def\listfigurename{Table des figures}% \def\listtablename{Liste des tableaux}% \def\indexname{Index}% - \def\figurename{\scshape Fig.}% - \def\tablename{\scshape Tab.}% - \def\@Fpt{\ifcase\value{part}\or Première\or Deuxième\or% - Troisième\or Quatrième\or Cinquième\or Sixième\or% - Septième\or Huitième\or Neuvième\or Dixième\or Onzième\or% - Douzième\or Treizième\or Quatorzième\or Quinzième\or% - Seizième\or Dix-septième\or Dix-huitième\or Dix-neuvième\or% + \def\figurename{\textsc{Fig.}}% + \def\tablename{\textsc{Tab.}}% + \def\@Fpt{\ifcase\value{part}\or Première\or Deuxième\or + Troisième\or Quatrième\or Cinquième\or Sixième\or + Septième\or Huitième\or Neuvième\or Dixième\or Onzième\or + Douzième\or Treizième\or Quatorzième\or Quinzième\or + Seizième\or Dix-septième\or Dix-huitième\or Dix-neuvième\or Vingtième\fi\space}% \def\thepart{}% \def\partname{\protect\@Fpt partie}% @@ -76,13 +94,13 @@ \def\proofname{Démonstration}% } \def\datefrench{% - \def\today{\ifx\ier\undefined\def\ier{er}\fi% + \def\today{\ifx\ier\undefined\def\ier{er}\fi \ifnum\day=1\relax 1\ier% - \else \number\day\fi% + \else \number\day\fi \space \ifcase\month% - \or janvier\or février\or mars\or avril\or mai\or juin\or% - juillet\or août\or septembre\or octobre\or novembre\or% - décembre\fi% + \or janvier\or février\or mars\or avril\or mai\or juin\or + juillet\or août\or septembre\or octobre\or novembre\or + décembre\fi \space \number\year}} \def\french@language{\language=\l@french} @@ -91,17 +109,16 @@ \def\noextras@french{% \nofrench@punctuation% - \nofrench@indent} + \nofrench@indent% + } \def\blockextras@french{% \french@punctuation% \french@indent% - \french@guillemets% } \def\inlineextras@french{% \french@punctuation% - \french@guillemets% } \endinput diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-galician.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-galician.ldf index 9a97d8c3aec..38c921c1a4f 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-galician.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-galician.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-galician.ldf}[polyglossia: module for galician] \makeatletter -\def\galician@font{\normalfontlatin} +\def\galician@font{\selectfontfamilylatin} \ifx\l@galician\@undefined% \xpg@nopatterns{Galician}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-german.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-german.ldf index 94041f8a677..49c7abc4e7c 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-german.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-german.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-german.ldf}[polyglossia: module for german] \makeatletter -\def\german@font{\normalfontlatin} +\def\german@font{\selectfontfamilylatin} \def\tmp@old{old} \def\tmp@oldyr{1901} @@ -47,9 +47,15 @@ \define@boolkey{german}[german@]{latesthyphen}[false]{} -\define@boolkey{german}[german@]{babelshorthands}[false]{} +\define@boolkey{german}[german@]{babelshorthands}[true]{} -\setkeys{german}{spelling,latesthyphen,babelshorthands,script} +\setkeys{german}{spelling,latesthyphen,script} + +\ifsystem@babelshorthands + \setkeys{german}{babelshorthands=true} +\else + \setkeys{german}{babelshorthands=false} +\fi \ifcsundef{initiate@active@char}{% \input{babelsh.def}% @@ -57,104 +63,104 @@ }{} \def\german@shorthands{% -\bbl@activate{"}% -\def\language@group{german}% -\declare@shorthand{german}{"`}{„}% -\declare@shorthand{german}{"'}{“}% -\declare@shorthand{german}{"<}{«}% -\declare@shorthand{german}{">}{»}% -\declare@shorthand{german}{"c}{\textormath{\bbl@disc@german ck}{c}}% -\declare@shorthand{german}{"C}{\textormath{\bbl@disc@german CK}{C}}% -\declare@shorthand{german}{"F}{\textormath{\bbl@disc@german F{FF}}{F}}% -\declare@shorthand{german}{"l}{\textormath{\bbl@disc@german l{ll}}{l}}% -\declare@shorthand{german}{"L}{\textormath{\bbl@disc@german L{LL}}{L}}% -\declare@shorthand{german}{"m}{\textormath{\bbl@disc@german m{mm}}{m}}% -\declare@shorthand{german}{"M}{\textormath{\bbl@disc@german M{MM}}{M}}% -\declare@shorthand{german}{"n}{\textormath{\bbl@disc@german n{nn}}{n}}% -\declare@shorthand{german}{"N}{\textormath{\bbl@disc@german N{NN}}{N}}% -\declare@shorthand{german}{"p}{\textormath{\bbl@disc@german p{pp}}{p}}% -\declare@shorthand{german}{"P}{\textormath{\bbl@disc@german P{PP}}{P}}% -\declare@shorthand{german}{"r}{\textormath{\bbl@disc@german r{rr}}{r}}% -\declare@shorthand{german}{"R}{\textormath{\bbl@disc@german R{RR}}{R}}% -\declare@shorthand{german}{"t}{\textormath{\bbl@disc@german t{tt}}{t}}% -\declare@shorthand{german}{"T}{\textormath{\bbl@disc@german T{TT}}{T}}% -\declare@shorthand{german}{"f}{\textormath{\bbl@discff}{f}}% -\def\bbl@discff{\penalty\@M - \afterassignment\bbl@insertff \let\bbl@nextff= }% -\def\bbl@insertff{% - \if f\bbl@nextff - \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi - {\relax\discretionary{ff-}{f}{ff}\allowhyphens}{f\bbl@nextff}}% -\let\bbl@nextff=f% -\declare@shorthand{german}{"-}{\nobreak\-\nobreak\hskip\z@skip}% -\declare@shorthand{german}{"|}{\textormath{\penalty\@M\discretionary{-}{}{\kern.03em}}{}}% -\declare@shorthand{german}{""}{\hskip\z@skip}% -\declare@shorthand{german}{"~}{\textormath{\leavevmode\hbox{-}}{-}}% -\declare@shorthand{german}{"=}{\penalty\@M-\hskip\z@skip}% -\def\ck{\allowhyphens\discretionary{k-}{k}{ck}\allowhyphens}% - } + \bbl@activate{"}% + \def\language@group{german}% + \declare@shorthand{german}{"`}{„}% + \declare@shorthand{german}{"'}{“}% + \declare@shorthand{german}{"<}{«}% + \declare@shorthand{german}{">}{»}% + \declare@shorthand{german}{"c}{\textormath{\bbl@disc@german ck}{c}}% + \declare@shorthand{german}{"C}{\textormath{\bbl@disc@german CK}{C}}% + \declare@shorthand{german}{"F}{\textormath{\bbl@disc@german F{FF}}{F}}% + \declare@shorthand{german}{"l}{\textormath{\bbl@disc@german l{ll}}{l}}% + \declare@shorthand{german}{"L}{\textormath{\bbl@disc@german L{LL}}{L}}% + \declare@shorthand{german}{"m}{\textormath{\bbl@disc@german m{mm}}{m}}% + \declare@shorthand{german}{"M}{\textormath{\bbl@disc@german M{MM}}{M}}% + \declare@shorthand{german}{"n}{\textormath{\bbl@disc@german n{nn}}{n}}% + \declare@shorthand{german}{"N}{\textormath{\bbl@disc@german N{NN}}{N}}% + \declare@shorthand{german}{"p}{\textormath{\bbl@disc@german p{pp}}{p}}% + \declare@shorthand{german}{"P}{\textormath{\bbl@disc@german P{PP}}{P}}% + \declare@shorthand{german}{"r}{\textormath{\bbl@disc@german r{rr}}{r}}% + \declare@shorthand{german}{"R}{\textormath{\bbl@disc@german R{RR}}{R}}% + \declare@shorthand{german}{"t}{\textormath{\bbl@disc@german t{tt}}{t}}% + \declare@shorthand{german}{"T}{\textormath{\bbl@disc@german T{TT}}{T}}% + \declare@shorthand{german}{"f}{\textormath{\bbl@discff}{f}}% + \def\bbl@discff{\penalty\@M + \afterassignment\bbl@insertff \let\bbl@nextff= }% + \def\bbl@insertff{% + \if f\bbl@nextff + \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + {\relax\discretionary{ff-}{f}{ff}\allowhyphens}{f\bbl@nextff}}% + \let\bbl@nextff=f% + \declare@shorthand{german}{"-}{\nobreak\-\nobreak\hskip\z@skip}% + \declare@shorthand{german}{"|}{\textormath{\penalty\@M\discretionary{-}{}{\kern.03em}}{}}% + \declare@shorthand{german}{""}{\hskip\z@skip}% + \declare@shorthand{german}{"~}{\textormath{\leavevmode\hbox{-}}{-}}% + \declare@shorthand{german}{"=}{\penalty\@M-\hskip\z@skip}% + \def\ck{\allowhyphens\discretionary{k-}{k}{ck}\allowhyphens}% +} \def\nogerman@shorthands{% - \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}% + \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}% } \def\captions@german{% - \def\prefacename{Vorwort}% - \def\refname{Literatur}% - \def\abstractname{Zusammenfassung}% - \def\bibname{Literaturverzeichnis}% - \def\chaptername{Kapitel}% - \def\appendixname{Anhang}% - \def\contentsname{Inhaltsverzeichnis}% - \def\listfigurename{Abbildungsverzeichnis}% - \def\listtablename{Tabellenverzeichnis}% - \def\indexname{Index}% - \def\figurename{Abbildung}% - \def\tablename{Tabelle}% - \def\partname{Teil}% - \def\enclname{Anlage(n)}% - \def\ccname{Verteiler}% - \def\headtoname{An}% - \def\pagename{Seite}% - \def\seename{siehe}% - \def\alsoname{siehe auch}% - \def\proofname{Beweis}% - \def\glossaryname{Glossar}% + \def\prefacename{Vorwort}% + \def\refname{Literatur}% + \def\abstractname{Zusammenfassung}% + \def\bibname{Literaturverzeichnis}% + \def\chaptername{Kapitel}% + \def\appendixname{Anhang}% + \def\contentsname{Inhaltsverzeichnis}% + \def\listfigurename{Abbildungsverzeichnis}% + \def\listtablename{Tabellenverzeichnis}% + \def\indexname{Index}% + \def\figurename{Abbildung}% + \def\tablename{Tabelle}% + \def\partname{Teil}% + \def\enclname{Anlage(n)}% + \def\ccname{Verteiler}% + \def\headtoname{An}% + \def\pagename{Seite}% + \def\seename{siehe}% + \def\alsoname{siehe auch}% + \def\proofname{Beweis}% + \def\glossaryname{Glossar}% } \def\date@german{% - \def\today{\number\day.% - \space \ifcase\month%TODO add option for Austrian forms (Jänner etc) - \or Januar\or Februar\or März\or April\or Mai\or Juni\or% - Juli\or August\or September\or Oktober\or November\or% - Dezember\fi% - \space \number\year}% + \def\today{\number\day.% + \space \ifcase\month%TODO add option for Austrian forms (Jänner etc) + \or Januar\or Februar\or März\or April\or Mai\or Juni\or% + Juli\or August\or September\or Oktober\or November\or% + Dezember\fi% + \space \number\year}% } %%Strings for Fraktur contributed by Gerrit \def\captions@german@fraktur{% - \captions@german% - \def\abstractname{Zuſammenfaſſung}% - \def\seename{ſiehe}% - \def\alsoname{ſiehe auch}% - \def\glossaryname{Gloſſar}% - } + \captions@german% + \def\abstractname{Zuſammenfaſſung}% + \def\seename{ſiehe}% + \def\alsoname{ſiehe auch}% + \def\glossaryname{Gloſſar}% +} \def\date@german@fraktur{% - \def\today{\number\day.% - \space \ifcase\month%TODO add option for Austrian forms (Jänner etc) - \or Januar\or Februar\or März\or April\or Mai\or Juni\or% - Juli\or Auguſt\or September\or Oktober\or November\or% - Dezember\fi% - \space \number\year}% + \def\today{\number\day.% + \space \ifcase\month%TODO add option for Austrian forms (Jänner etc) + \or Januar\or Februar\or März\or April\or Mai\or Juni\or% + Juli\or Auguſt\or September\or Oktober\or November\or% + Dezember\fi% + \space \number\year}% } \def\captionsgerman{% - \if@german@fraktur\captions@german@fraktur\else\captions@german\fi% - } + \if@german@fraktur\captions@german@fraktur\else\captions@german\fi% +} \def\dategerman{% - \if@german@fraktur\date@german@fraktur\else\date@german\fi% - } + \if@german@fraktur\date@german@fraktur\else\date@german\fi% +} \def\german@language{\language=% \csname l@\if@german@oldspelling\else n\fi german\ifgerman@latesthyphen -x-latest\fi\endcsname} @@ -162,18 +168,18 @@ \setlocalhyphenmins{german}{2}{2}% \def\noextras@german{% - \nonfrenchspacing% - \nogerman@shorthands% + \nonfrenchspacing% + \nogerman@shorthands% } \def\blockextras@german{% - \frenchspacing% - \ifgerman@babelshorthands\german@shorthands\fi% + \frenchspacing% + \ifgerman@babelshorthands\german@shorthands\fi% } \def\inlineextras@german{% - \frenchspacing% - \ifgerman@babelshorthands\german@shorthands\fi% + \frenchspacing% + \ifgerman@babelshorthands\german@shorthands\fi% } \endinput diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-greek.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-greek.ldf index f712221be42..a305e0fc21a 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-greek.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-greek.ldf @@ -657,6 +657,7 @@ \def\greek@font{% \@ifundefined{greekfont}{% + \normalfontlatin% \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt \zf@check@ot@script{grek}% \if@tempswa% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-hebrew.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-hebrew.ldf index b3013b3fd65..bcf860ad2ee 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-hebrew.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-hebrew.ldf @@ -15,9 +15,9 @@ \define@key{hebrew}{calendar}[gregorian]{% \def\@tmpa{#1}% \ifx\@tmpa\tmp@hebrew% - \@calendar@hebrewtrue% + \@calendar@hebrewtrue% \else% - \@calendar@hebrewfalse% + \@calendar@hebrewfalse% \fi} % hebrewcal.sty also defines the boolean key fullyear (default=false) @@ -29,7 +29,7 @@ \ifx\@tmpa\tmp@hebrew% \@hebrew@numeralstrue% \else% - \@hebrew@numeralsfalse% + \@hebrew@numeralsfalse% \fi} \setkeys{hebrew}{numerals} @@ -49,7 +49,7 @@ \def\tablename{טבלה}% \def\partname{חלק}% \def\enclname{רצ"ב}% - \def\ccname{העטקים}% + \def\ccname{העתקים}% \def\headtoname{אל}% \def\pagename{עמוד}% \def\psname{נ.ב.}% @@ -76,119 +76,79 @@ \or יוני\or יולי\or אוגוסט %אבגוסט \or ספטמבר\or אוקטובר\or נובמבר\or דצמבר\fi} +\input{babel-hebrewalph.def} -\def\hebrewalph#1{% -\ifnum#1>9999 \xpg@warning{Illegal value (#1) for Hebrew numeral} {#1} -\else - \ifnum#1<\z@\space\xpg@warning{Illegal value (#1) for Hebrew numeral}% - \else - \ifnum#1<10\expandafter\heb@num@i\number#1% - \else - \ifnum#1<100\expandafter\heb@num@ii\number#1% - \else - \ifnum#1<\@m\expandafter\heb@num@iii\number#1% - \else - \ifnum#1<\@M\expandafter\heb@num@iv\number#1% - \fi - \fi - \fi - \fi - \fi -\fi +\def\hebrewnumber#1{% + \if@hebrew@numerals + \protect\hebrewnumeral{#1}% + \else + %%\RL{\protect\reset@font\protect\number#1}% + \number#1% + \fi } -\let\hebrewnumeral\hebrewalph - -\def\hebnum@zero{} - -%Hebrew alphabetic numerals (primitive implementation -- the code in Babel is more complex): -\def\heb@num@i#1{% - \ifcase#1\or\char"05D0\or\char"05D1\or\char"05D2\or\char"05D3\or\char"05D4% - \or\char"05D5\or\char"05D6\or\char"05D7\or\char"05D8\fi - \ifnum#1=\z@\hebnum@zero\fi} -\def\heb@num@ii#1{% - \ifcase#1\or\char"05D9\or\char"05DB\or\char"05DC\or\char"05DE\or\char"05E0% - \or\char"05E1\or\char"05E2\or\char"05E4\or\char"05E6\fi - \ifnum#1=\z@\fi\heb@num@i} -\def\heb@num@iii#1{% - \ifcase#1\or\char"05E7\or\char"05E8\or\char"05E9\or\char"05EA\or\char"05DA% - \or\char"05DD\or\char"05DF\or\char"05E3\or\char"05E5\fi - \ifnum#1=\z@\fi\heb@num@ii} -\def\heb@num@iv#1{% - \ifcase#1\or\char"05D0\char"05F3\or\char"05D1\char"05F3\or\char"05D2\char"05F3% - \or\char"05D3\char"05F3\or\char"05D4\char"05F3\or\char"05D5\char"05F3% - \or\char"05D6\char"05F3\or\char"05D7\char"05F3\or\char"05D8\char"05F3\fi - \ifnum#1=\z@\fi\heb@num@iii} -%TODO [optionally] -% -insert gereshayim (\char"05F4) before last letter of a sequence of two letters or more -% -insert geresh (\char"05F3) after letter if it is alone \def\hebrew@numbers{% - \let\@latinalph\@alph% - \let\@latinAlph\@Alph% - \let\@alph\hebrewalph% - \let\@Alph\hebrewalph% + \let\@origalph\@alph% + \let\@origAlph\@Alph% + \let\@alph\hebrewnumeral% + \let\@Alph\Hebrewnumeral% } \def\nohebrew@numbers{% - \let\@alph\@latinalph% - \let\@Alph\@latinAlph% - } - -\def\hebrewnumber#1{% - \if@hebrew@numerals\hebrewalph{#1}% - \else{\reset@font\number#1}% - \fi} + \let\@alph\@origalph% + \let\@Alph\@origAlph% +} \def\hebrew@globalnumbers{% - \let\@latinarabic\@arabic% + \let\orig@arabic\@arabic% \let\@arabic\hebrewnumber% \renewcommand\thefootnote{\protect\hebrewnumber{\c@footnote}}% - } - -\def\nohebrew@globalnumbers{ - \let\@arabic\@latinarabic% - \renewcommand\thefootnote{\protect\number{\c@footnote}}% - } +} +\def\nohebrew@globalnumbers{% + \let\@arabic\orig@arabic% + \renewcommand\thefootnote{\protect\number{\c@footnote}}% +} \def\hebrew@language{\language=\l@hebrew} \def\hebrew@font{% \@ifundefined{hebrewfont}{% + \normalfontlatin% \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt \zf@check@ot@script{hebr}% - \if@tempswa% + \if@tempswa \addfontfeature{Script=Hebrew}% - \else% + \else \PackageError{polyglossia}{^^J - The current font does not contain the Hebrew script!^^J - Please define \string\hebrewfont\space with \string\newfontfamily}% - \fi% - }% -{\hebrewfont}} + The current font does not contain the Hebrew script!^^J + Please define \string\hebrewfont\space with \string\newfontfamily}% + \fi}% + {\hebrewfont}% +} % TODO add setup to define Sans and Mono Hebrew fonts if desired \def\hebrew@font@sf{% \@ifundefined{hebrewfontsf}{% -% \sffamily% FIXME +% \sffamilylatin% FIXME % \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt % \zf@check@ot@script{arab}% % \if@tempswa% % \addfontfeature{Script=Hebrew}% % \else% \hebrew@font% -% \fi% +% \fi% }% {\hebrewfontsf}% } \def\hebrew@font@tt{% \@ifundefined{hebrewfonttt}{% -% \ttfamily% FIXME -% \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt -% \zf@check@ot@script{arab}% -% \if@tempswa% -% \addfontfeature{Script=Hebrew}% -% \else% - \hebrew@font% -% \fi% +% \ttfamilylatin% FIXME +% \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt +% \zf@check@ot@script{arab}% +% \if@tempswa% +% \addfontfeature{Script=Hebrew}% +% \else% + \hebrew@font% +% \fi% }% {\hebrewfonttt}% } diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-hindi.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-hindi.ldf index bc55764c099..8f3772591a1 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-hindi.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-hindi.ldf @@ -1,7 +1,7 @@ \ProvidesFile{gloss-hindi.ldf}[polyglossia: module for hindi] % UTF-8 strings kindly provided by Zdenek Wagner, 10-03-2008 % TODO: add option for velthuis transliteration with link to -% Velthuis Devanagari project: http://devnag.sarovar.org. +% Velthuis Devanagari project: http://devnag.sarovar.org. \makeatletter \ifx\l@hindi\@undefined% @@ -59,25 +59,26 @@ \def\hindi@language{\language=\l@hindi} \def\hindi@font{% -\font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt -\@ifundefined{hindifont}{% - \@ifundefined{devanagarifont}{% - \zf@check@ot@script{deva}% - \if@tempswa% - \addfontfeature{Script=Devanagari}% - \else% - \PackageError{polyglossia}{^^J - The current font does not contain the Devanagari script!^^J - Please define \string\devanagarifont\space or \string\hindifont\space with \string\newfontfamily}% - \fi% - \zf@check@ot@lang{HIN}% - \if@tempswa\addfontfeature{Language=Hindi}\fi% - }% - {\devanagarifont% - \zf@check@ot@lang{HIN}% - \if@tempswa\addfontfeature{Language=Hindi}\fi% - }}% - {\hindifont}% + \@ifundefined{hindifont}{% + \normalfontlatin% + \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt + \@ifundefined{devanagarifont}{% + \zf@check@ot@script{deva}% + \if@tempswa% + \addfontfeature{Script=Devanagari}% + \else% + \PackageError{polyglossia}{^^J + The current font does not contain the Devanagari script!^^J + Please define \string\devanagarifont\space or \string\hindifont\space with \string\newfontfamily}% + \fi% + \zf@check@ot@lang{HIN}% + \if@tempswa\addfontfeature{Language=Hindi}\fi% + }% + {\devanagarifont% + \zf@check@ot@lang{HIN}% + \if@tempswa\addfontfeature{Language=Hindi}\fi% + }}% + {\hindifont}% } \def\selectnormalfonthindi{% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-icelandic.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-icelandic.ldf index c735dcb37ce..09b8f31d586 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-icelandic.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-icelandic.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-icelandic.ldf}[polyglossia: module for icelandic] \makeatletter -\def\icelandic@font{\normalfontlatin} +\def\icelandic@font{\selectfontfamilylatin} \ifx\l@icelandic\@undefined% \xpg@nopatterns{Icelandic}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-irish.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-irish.ldf index 5c29d736720..cbe5ec9e851 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-irish.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-irish.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-irish.ldf}[polyglossia: module for irish] \makeatletter -\def\irish@font{\normalfontlatin} +\def\irish@font{\selectfontfamilylatin} \ifx\l@irish\@undefined% \xpg@nopatterns{Irish}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-italian.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-italian.ldf index 0b5a9842788..f8620e655d1 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-italian.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-italian.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-italian.ldf}[polyglossia: module for italian] \makeatletter -\def\italian@font{\normalfontlatin} +\def\italian@font{\selectfontfamilylatin} \ifx\l@italian\@undefined \xpg@nopatterns{Italian} diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-latin.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-latin.ldf index 0a411130486..871af43e1c7 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-latin.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-latin.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-latin.ldf}[polyglossia: module for latin] \makeatletter -\def\latin@font{\normalfontlatin} +\def\latin@font{\selectfontfamilylatin} \ifx\l@latin\@undefined \xpg@nopatterns{latin} diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-latvian.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-latvian.ldf index 5f118434fbd..beeba264ca5 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-latvian.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-latvian.ldf @@ -1,10 +1,10 @@ \ProvidesFile{gloss-latvian.ldf}[polyglossia: module for latvian] \makeatletter -\def\latvian@font{\normalfontlatin} +\def\latvian@font{\selectfontfamilylatin} \ifx\l@latvian\@undefined \xpg@nopatterns{Latvian} - \adddialect\l@latvian\l@nohyphenation + \adddialect\l@latvian\l@nohyphenation\relax \fi \def\captionslatvian{% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-lithuanian.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-lithuanian.ldf new file mode 100644 index 00000000000..ecfb61d68b3 --- /dev/null +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-lithuanian.ldf @@ -0,0 +1,67 @@ +% Translated by Paulius Sladkevičius + +\ProvidesFile{gloss-lithuanian.ldf}[polyglossia: module for lithuanian] +\makeatletter + +\ifx\l@lithuanian\@undefined% + \xpg@nopatterns{Lithuanian}% + \adddialect\l@lithuanian\l@nohyphenation\relax +\fi + +\def\captionslithuanian{% + \def\refname{\textlithuanian{Literatūra}}% + \def\abstractname{\textlithuanian{Santrauka}}% + \def\bibname{\textlithuanian{Literatūra}}% + \def\prefacename{\textlithuanian{Pratarmė}}% + \def\chaptername{\textlithuanian{Skyrius}}% + \def\appendixname{\textlithuanian{Priedas}}% + \def\contentsname{\textlithuanian{Turinys}}% + \def\listfigurename{\textlithuanian{Iliustracijų sąrašas}}% + \def\listtablename{\textlithuanian{Lentelių sąrašas}}% + \def\indexname{\textlithuanian{Rodyklė}}% + \def\figurename{\textlithuanian{Pav.}}% + \def\tablename{\textlithuanian{Lentelė}}% + %\def\thepart{\textlithuanian{}}% Roman numerals are fine + \def\partname{\textlithuanian{Dalis}}% + \def\pagename{\textlithuanian{Puslapis}}% + \def\seename{\textlithuanian{žiūrėk}}% + \def\alsoname{\textlithuanian{tai pat}}% + \def\enclname{\textlithuanian{Įdėta}}% + \def\ccname{\textlithuanian{Kopijos}}% + \def\headtoname{\textlithuanian{Kam}}% + \def\proofname{\textlithuanian{Įrodymas}}% + \def\glossaryname{\textlithuanian{Terminų žodynas}}% + } +\def\datelithuanian{% + \def\lithuanianmonth{\ifcase\month\or% + sausio\or% Jan + vasario\or% Feb + kovo\or% Mar + balandžio\or% Apr + gegužės\or% May + birželio\or% Jun + liepos\or% Jul + rugpjūčio\or% Aug + rugsėjo\or% Sep + spalio\or% Oct + lapkričio\or% Nov + gruodžio% Dec + \fi} + \def\today{\textlithuanian{\number\year~m.~\lithuanianmonth~\number\day~d.}}% + } + +\def\lithuanian@font{\selectfontfamilylatin} % <== if the script is Latin + +\def\lithuanian@language{\protect\language=\l@lithuanian} + +\setlocalhyphenmins{lithuanian}{2}{2}% + +\def\noextras@lithuanian{% + } + +\def\blockextras@lithuanian{% + } + +\def\inlineextras@lithuanian{% + } + diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-lsorbian.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-lsorbian.ldf index 87660aa1818..8b530ae855c 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-lsorbian.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-lsorbian.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-lsorbian.ldf}[polyglossia: module for lower sorbian] \makeatletter -\def\lsorbian@font{\normalfontlatin} +\def\lsorbian@font{\selectfontfamilylatin} \ifx\l@lowersorbian\@undefined \ifx\l@lsorbian\@undefined diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-magyar.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-magyar.ldf index 7f42b214006..d74b545e439 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-magyar.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-magyar.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-magyar.ldf}[polyglossia: module for magyar] \makeatletter -\def\magyar@font{\normalfontlatin} +\def\magyar@font{\selectfontfamilylatin} \ifx\l@magyar\@undefined \ifx\l@hungarian\@undefined diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-norsk.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-norsk.ldf index 436cb855794..46f81bf143c 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-norsk.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-norsk.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-norsk.ldf}[polyglossia: module for norwegian] \makeatletter -\def\norsk@font{\normalfontlatin} +\def\norsk@font{\selectfontfamilylatin} \ifx\l@norsk\@undefined% \xpg@nopatterns{Norsk}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-nynorsk.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-nynorsk.ldf index 6d944e9b9e7..276a1410116 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-nynorsk.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-nynorsk.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-nynorsk.ldf}[polyglossia: module for norwegian (Nynorsk)] \makeatletter -\def\nynorsk@font{\normalfontlatin} +\def\nynorsk@font{\selectfontfamilylatin} \ifx\l@nynorsk\@undefined% \xpg@nopatterns{Nynorsk}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-polish.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-polish.ldf index 50d1436c0ed..d3519b9562d 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-polish.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-polish.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-polish.ldf}[polyglossia: module for polish] \makeatletter -\def\polish@font{\normalfontlatin} +\def\polish@font{\selectfontfamilylatin} \ifx\l@polish\@undefined \xpg@nopatterns{polish} diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-portuges.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-portuges.ldf index 5c3283600a1..dbc6f9922d4 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-portuges.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-portuges.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-portuges.ldf}[polyglossia: module for portuguese] \makeatletter -\def\portuges@font{\normalfontlatin} +\def\portuges@font{\selectfontfamilylatin} \ifx\l@portuges\@undefined \ifx\l@portuguese\@undefined diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-romanian.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-romanian.ldf index e69f75ec3f9..0be15d42dde 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-romanian.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-romanian.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-romanian.ldf}[polyglossia: module for romanian] \makeatletter -\def\romanian@font{\normalfontlatin} +\def\romanian@font{\selectfontfamilylatin}%TODO\addfontfeature{Language=Romanian} \ifx\l@romanian\@undefined% \xpg@nopatterns{Romanian}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-russian.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-russian.ldf index 0ad8bc9a461..4e7684f3d50 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-russian.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-russian.ldf @@ -7,25 +7,27 @@ \fi \def\russian@font{% -\font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt -\@ifundefined{russianfont}{% - \@ifundefined{cyrillicfont}{% - \zf@check@ot@script{cyrl}% - \if@tempswa% - \addfontfeature{Script=Cyrillic}% - \else% - \PackageError{polyglossia}{^^J - The current font does not contain the Cyrillic script!^^J - Please define \string\cyrillicfont\space or \string\russianfont\space with \string\newfontfamily}% - \fi% - \zf@check@ot@lang{RUS}% - \if@tempswa\addfontfeature{Language=Russian}\fi% - }% - {\cyrillicfont% - \zf@check@ot@lang{RUS}% - \if@tempswa\addfontfeature{Language=Russian}\fi}% - }% - {\russianfont}% + \@ifundefined{russianfont}{% + \@ifundefined{cyrillicfont}{% + \normalfontlatin% + \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt + \zf@check@ot@script{cyrl}% + \if@tempswa + \addfontfeature{Script=Cyrillic}% + \else + \PackageError{polyglossia}{^^J + The current font does not contain the Cyrillic script!^^J + Please define \string\cyrillicfont\space or \string\russianfont\space with \string\newfontfamily}% + \fi + \zf@check@ot@lang{RUS}% + \if@tempswa\addfontfeature{Language=Russian}\fi + }% + {\cyrillicfont% + \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt + \zf@check@ot@lang{RUS}% + \if@tempswa\addfontfeature{Language=Russian}\fi}% + }% + {\russianfont}% } \def\tmp@old{old} @@ -39,7 +41,19 @@ \def\daterussian{\daterussian@modern}% \fi} -\setkeys{russian}{spelling} +%TODO: enable key to switch between latin and cyrillic \alph +\def\tmp@latin{latin} +\newif\iflatin@numerals +\define@key{russian}{numerals}[russian]{% + \def\@tmpa{#1}% + \ifx\@tmpa\tmp@latin + \latin@numeralstrue + \else + \latin@numeralsfalse + \fi +} + +\setkeys{russian}{spelling,numerals} \def\captionsrussian@modern{% \def\prefacename{Предисловие}% @@ -49,8 +63,8 @@ \def\chaptername{Глава}% \def\appendixname{Приложение}% \ifcsundef{thechapter}% - {\def\contentsname{Содержание}}% - {\def\contentsname{Оглавление}}% + {\def\contentsname{Содержание}}% + {\def\contentsname{Оглавление}}% \def\listfigurename{Список иллюстраций}% \def\listtablename{Список таблиц}% \def\indexname{Предметный указатель}% @@ -91,8 +105,8 @@ \def\chaptername{Глава}% \def\appendixname{Приложеніе}% \ifcsundef{thechapter}% - {\def\contentsname{Содержаніе}}% - {\def\contentsname{Оглавленіе}}% + {\def\contentsname{Содержаніе}}% + {\def\contentsname{Оглавленіе}}% \def\listfigurename{Списокъ иллюстрацій}% \def\listtablename{Списокъ таблицъ}% \def\indexname{Предмѣтный указатель}% @@ -145,12 +159,12 @@ \def\presubparagraph{}} \def\russian@Alph#1{\ifcase#1\or - А\or Б\or В\or г\or д\or Е\or Ж\or + А\or Б\or В\or Г\or Д\or Е\or Ж\or З\or И\or К\or Л\or М\or Н\or О\or П\or Р\or С\or Т\or У\or Ф\or Х\or Ц\or Ч\or Ш\or Щ\or Э\or Ю\or Я\else\xpg@ill@value{#1}{russian@Alph}\fi} \def\russian@alph#1{\ifcase#1\or - а\or б\or в\or Г\or Д\or е\or ж\or + а\or б\or в\or г\or д\or е\or ж\or з\or и\or к\or л\or м\or н\or о\or п\or р\or с\or т\or у\or ф\or х\or ц\or ч\or ш\or щ\or э\or ю\or я\else\xpg@ill@value{#1}{russian@alph}\fi} @@ -174,11 +188,13 @@ \def\noextras@russian{% \nonfrenchspacing% \def\@seccntformat##1{\csname the##1\endcsname\quad}% = LaTeX kernel + \iflatin@numerals\else\norussian@numbers\fi } - + \def\blockextras@russian{% \frenchspacing% \russian@capsformat% + \iflatin@numerals\else\russian@numbers\fi } \def\inlineextras@russian{% @@ -186,24 +202,3 @@ } \endinput - -%\def\russian@punctuation{% -% \frenchspacing% -% \def\No{№\kern.1667em}% -% \def\cyrdash{—}% -% \def\PlainTextEmDash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi% -% \cyrdash\hskip.2em\ignorespaces}% -% \def\CompoundNamesEmDash{\leavevmode\ifdim\lastskip>\z@\unskip\fi% -% \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}% -% \def\DirectSpeechEmDash{\leavevmode% -% \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}} -% -%\def\norussian@punctuation{% -% \nonfrenchspacing% -% \let\No\@undefined% -% \let\cyrdash\@undefined% -% \let\PlainTextEmDash\@undefined% -% \let\CompoundNamesEmDash\@undefined% -% \let\DirectSpeechEmDash\@undefined% -%} - diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-samin.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-samin.ldf index d44e4bc6538..3d21b6ea6e7 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-samin.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-samin.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-samin.ldf}[polyglossia: module for samin] \makeatletter -\def\samin@font{\normalfontlatin} +\def\samin@font{\selectfontfamilylatin} \ifx\l@samin\@undefined% \xpg@nopatterns{Samin}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-sanskrit.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-sanskrit.ldf index 563066981c7..d548d8a5570 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-sanskrit.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-sanskrit.ldf @@ -98,7 +98,7 @@ \def\sanskrit@language{\language=\l@sanskrit} -\setlocalhyphenmins{sanskrit}{1}{5}% +\setlocalhyphenmins{sanskrit}{1}{3}% \def\noextras@sanskrit{% \nosanskrit@punctuation% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-scottish.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-scottish.ldf index 5e6dafd26de..c9a7ef45924 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-scottish.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-scottish.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-scottish.ldf}[polyglossia: module for scottish] \makeatletter -\def\scottish@font{\normalfontlatin} +\def\scottish@font{\selectfontfamilylatin} \ifx\l@scottish\@undefined% \xpg@nopatterns{Scottish}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-serbian.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-serbian.ldf index 5ed4034f87a..d98e8c39e3d 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-serbian.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-serbian.ldf @@ -10,10 +10,10 @@ \newif\if@serbian@cyr \def\tmp@cyrillic{cyrillic} \define@key{serbian}{script}[cyrillic]{% - \def\@tmpa{#1}% - \ifx\@tmpa\tmp@cyrillic\@serbian@cyrtrue\else% - \@serbian@cyrfalse\fi% - \fi} + \def\@tmpa{#1}% + \ifx\@tmpa\tmp@cyrillic\@serbian@cyrtrue\else% + \@serbian@cyrfalse + \fi} \setkeys{serbian}{script} @@ -48,7 +48,7 @@ \def\proofname{Dokaz}% \def\glossaryname{Glosar}% <-- CHECK } -\def\dateserbian@lat{% +\def\dateserbian@lat{% \def\today{\number\day .~\ifcase\month\or januar\or februar\or mart\or april\or maj\or juni\or juli\or avgust\or septembar\or oktobar\or novembar\or @@ -88,34 +88,35 @@ } \def\serbian@font@cyr{% -\font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt -\@ifundefined{serbianfont}{% - \@ifundefined{cyrillicfont}{% - \zf@check@ot@script{cyrl}% - \if@tempswa% - \addfontfeature{Script=Cyrillic}% - \else% - \PackageError{polyglossia}{^^J - The current font does not contain the Cyrillic script!^^J - Please define \string\cyrillicfont\space or \string\serbianfont\space with \string\newfontfamily}% - \fi% - \zf@check@ot@lang{SRB}% - \if@tempswa\addfontfeature{Language=Serbian}\fi% - }% - {\cyrillicfont% - \zf@check@ot@lang{SRB}% - \if@tempswa\addfontfeature{Language=Serbian}\fi% - }% - }% - {\serbianfont}% + \@ifundefined{serbianfont}{% + \@ifundefined{cyrillicfont}{% + \normalfontlatin% + \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt + \zf@check@ot@script{cyrl}% + \if@tempswa + \addfontfeature{Script=Cyrillic}% + \else + \PackageError{polyglossia}{^^J + The current font does not contain the Cyrillic script!^^J + Please define \string\cyrillicfont\space or \string\serbianfont\space with \string\newfontfamily}% + \fi% + \zf@check@ot@lang{SRB}% + \if@tempswa\addfontfeature{Language=Serbian}\fi}% + {\cyrillicfont% + \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt + \zf@check@ot@lang{SRB}% + \if@tempswa\addfontfeature{Language=Serbian}\fi}% + }% + {\serbianfont}% } \def\serbian@font@lat{% - \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt - \@ifundefined{serbianfontlatin}{% - \zf@check@ot@lang{SRB}% - \if@tempswa\addfontfeature{Language=Serbian}\fi}% - {\serbianfontlatin}% + \@ifundefined{serbianfontlatin}{% + \normalfontlatin% + \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt + \zf@check@ot@lang{SRB}% + \if@tempswa\addfontfeature{Language=Serbian}\fi}% + {\serbianfontlatin}% } \def\serbian@font{% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-slovak.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-slovak.ldf index cd28569577b..0b13231f3b7 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-slovak.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-slovak.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-slovak.ldf}[polyglossia: module for slovak] \makeatletter -\def\slovak@font{\normalfontlatin} +\def\slovak@font{\selectfontfamilylatin} \ifx\l@slovak\@undefined% \xpg@nopatterns{Slovak}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-slovenian.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-slovenian.ldf index febdcac0293..d60fa5b1e5f 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-slovenian.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-slovenian.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-slovenian.ldf}[polyglossia: module for slovenian] \makeatletter -\def\slovenian@font{\normalfontlatin} +\def\slovenian@font{\selectfontfamilylatin} \ifx\l@slovenian\@undefined% \ifx\l@slovene\@undefined% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-spanish.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-spanish.ldf index d1be8fb06da..05ed105e8c2 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-spanish.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-spanish.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-spanish.ldf}[polyglossia: module for spanish] \makeatletter -\def\spanish@font{\normalfontlatin} +\def\spanish@font{\selectfontfamilylatin} \ifx\l@spanish\@undefined \xpg@nopatterns{spanish} diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-swedish.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-swedish.ldf index 3c07c5b6884..5efa82e1ec1 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-swedish.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-swedish.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-swedish.ldf}[polyglossia: module for swedish] \makeatletter -\def\swedish@font{\normalfontlatin} +\def\swedish@font{\selectfontfamilylatin} \ifx\l@swedish\@undefined% \xpg@nopatterns{Swedish}% 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} diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-thai.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-thai.ldf index 0dda46f13c3..7a51a04c82e 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-thai.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-thai.ldf @@ -62,7 +62,23 @@ %\catcode"200b=\active %\def^^200b{\hskip 0pt plus .4em} -\def\thainumber#1{\if@thai@numerals{\protect\addfontfeature{Mapping=thaidigits}\protect\number#1}\else{\protect\reset@font\protect\number#1}\fi} +\def\thaidigits#1{\expandafter\@thai@digits #1@} +\def\@thai@digits#1{% + \ifx @#1% then terminate + \else + \ifx0#1๐\else\ifx1#1๑\else\ifx2#1๒\else\ifx3#1๓\else\ifx4#1๔\else\ifx5#1๕\else\ifx6#1๖\else\ifx7#1๗\else\ifx8#1๘\else\ifx9#1๙\else#1\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \expandafter\@thai@digits + \fi +} + +\def\thainumber#1{% + \if@thai@numerals% + \thaidigits{\number#1}% + %%{\protect\addfontfeature{Mapping=thaidigits}\protect\number#1} + \else% + \number#1% + %%{\protect\reset@font\number#1} + \fi} \def\@thaialph#1{% \ifcase#1\or ก\or ข\or ค\or ง\or จ\or ฉ\or ช\or ซ\or ฌ\or ญ\or ฎ\or @@ -82,7 +98,7 @@ \if@thai@numerals% \let\@alph\@thaialph% \let\@Alph\@thaiAlph% - \fi% + \fi } \def\nothai@numbers{% \let\@alph\@latinalph% @@ -90,28 +106,29 @@ } \def\thai@globalnumbers{% - \let\@latinarabic\@arabic% + \let\orig@arabic\@arabic% \let\@arabic\thainumber% \renewcommand{\thefootnote}{\protect\thainumber{\c@footnote}}% } \def\nothai@globalnumbers{% - \let\@arabic\@latinarabic% - \renewcommand{\thefootnote}{\protect\number{\c@footnote}}% + \let\@arabic\orig@arabic% + \renewcommand\thefootnote{\protect\number{\c@footnote}}% } \def\thai@font{% \@ifundefined{thaifont}{% + \normalfontlatin% \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt \zf@check@ot@script{thai}% - \if@tempswa% + \if@tempswa \addfontfeature{Script=Thai}% - \else% + \else \PackageError{polyglossia}{^^J - The current font does not contain the Thai script!^^J - Please define \string\thaifont\space with \string\newfontfamily}% - \fi% - }% - {\thaifont}} + The current font does not contain the Thai script!^^J + Please define \string\thaifont\space with \string\newfontfamily}% + \fi}% + {\thaifont}% +} \def\selectnormalfontthai{% \let\normalfont=\thai@font% @@ -123,7 +140,11 @@ \def\thai@language{\language=\l@nohyphenation} \def\blockextras@thai{% - \renewcommand{\baselinestretch}{1.2}% FIXME restore default value in noextras? + \let\orig@baselinestrech\baselinestretch% + \renewcommand{\baselinestretch}{1.2}% + } +\def\noblockextras@thai{% + \let\baselinestrech\orig@baselinestretch% } \endinput diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-turkish.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-turkish.ldf index c03cd251a43..68665f6f6ca 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-turkish.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-turkish.ldf @@ -1,4 +1,5 @@ \ProvidesFile{gloss-turkish.ldf}[polyglossia: module for turkish] +\RequirePackage{hijrical} \makeatletter \def\turkish@font{% @@ -72,6 +73,11 @@ Aralık\fi \space\number\year} } +\def\hijrimonthturkish#1{\ifcase#1% +\or Muharrem\or Safer\or Rebiülevvel\or Rebiülahir\or Cemaziyelevvel\or Cemaziyelahir\or Recep\or Şaban\or Ramazan\or Şevval\or Zilkade\or Zilhicce\fi} +%%\Hijritoday is now locale-aware and will format the date with this macro: +\DefineFormatHijriDate{turkish}{% +\number\value{Hijriday}\space\hijrimonthturkish{\value{Hijrimonth}}\space\number\value{Hijriyear}} \def\turkish@language{\language=\l@turkish} diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-ukrainian.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-ukrainian.ldf index d7750e3a0f6..a96a838d825 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-ukrainian.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-ukrainian.ldf @@ -10,27 +10,27 @@ \fi \def\ukrainian@font{% -\font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt -\@ifundefined{ukrainianfont}{% - \@ifundefined{cyrillicfont}{% - \zf@check@ot@script{cyrl}% - \if@tempswa% - \addfontfeature{Script=Cyrillic}% - \else% - \PackageError{polyglossia}{^^J - The current font does not contain the Cyrillic script!^^J - Please define \string\cyrillicfont\space or \string\ukrainianfont\space with \newfontfamily}% - \fi% - \zf@check@ot@lang{UKR}% - \if@tempswa\addfontfeature{Language=Ukrainian}\fi - }% - {\cyrillicfont% - \zf@check@ot@lang{UKR}% - \if@tempswa\addfontfeature{Language=Ukrainian}\fi% - }% - }% - {\ukrainianfont}% -}% + \@ifundefined{ukrainianfont}{% + \@ifundefined{cyrillicfont}{% + \normalfontlatin% + \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt + \zf@check@ot@script{cyrl}% + \if@tempswa + \addfontfeature{Script=Cyrillic}% + \else + \PackageError{polyglossia}{^^J + The current font does not contain the Cyrillic script!^^J + Please define \string\cyrillicfont\space or \string\ukrainianfont\space with \newfontfamily}% + \fi + \zf@check@ot@lang{UKR}% + \if@tempswa\addfontfeature{Language=Ukrainian}\fi + }% + {\cyrillicfont% + \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt + \zf@check@ot@lang{UKR}% + \if@tempswa\addfontfeature{Language=Ukrainian}\fi}}% + {\ukrainianfont}% +} \def\captionsukrainian{% \def\refname{Література}% @@ -78,24 +78,24 @@ З\or И\or І\or Ї\or Й\or К\or Л\or М\or Н\or О\or П\or Р\or С\or Т\or У\or Ф\or Х\or Ц\or Ч\or Ш\or Щ\or Ю\or Я\else\xpg@ill@value{#1}{ukrainian@Alph}\fi} -\def\ukrainian@alph#1{\ifcase#1\or +\def\ukrainian@alph#1{\ifcase#1\or а\or б\or в\or г\or д\or е\or є\or ж\or з\or и\or і\or ї\or й\or к\or л\or м\or н\or о\or п\or р\or с\or т\or у\or ф\or х\or ц\or ч\or ш\or щ\or ю\or я\else\xpg@ill@value{#1}{ukrainian@alph}\fi} \def\ukrainian@numbers{% - \let\latin@Alph\@Alph% - \let\latin@alph\@alph% + \let\latin@Alph\@Alph% + \let\latin@alph\@alph% \let\@Alph\ukrainian@Alph% \let\@alph\ukrainian@alph% } \def\noukrainian@numbers{% - \let\@Alph\latin@Alph% + \let\@Alph\latin@Alph% \let\@alph\latin@alph% } - + \def\ukrainian@language{\language=\l@ukrainian} \setlocalhyphenmins{ukrainian}{2}{2}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-urdu.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-urdu.ldf new file mode 100644 index 00000000000..a1759c19ed5 --- /dev/null +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-urdu.ldf @@ -0,0 +1,190 @@ +%%% Adapted from a file contributed by Kamal Abdali +\ProvidesFile{gloss-urdu.ldf}[polyglossia: module for Urdu] +\RequirePackage{bidi} +\RequirePackage{arabicnumbers} +\RequirePackage{hijrical} +\makeatletter + +\ifx\l@urdu\@undefined + %\xpg@nopatterns{urdu}% + \adddialect\l@urdu\l@nohyphenation +\fi + +\def\urdu@RL{\relax} + +\newif\if@western@numerals +\def\tmp@western{western} +\define@key{urdu}{numerals}[eastern]{% + \def\@tmpa{#1}% + \ifx\@tmpa\tmp@western\@western@numeralstrue% + \else\@western@numeralsfalse% + \fi} + +%this is needed for \abjad in arabicnumbers.sty +\def\tmp@true{true} +\define@key{urdu}{abjadjimnotail}[true]{% + \def\@tmpa{#1}% + \ifx\@tmpa\tmp@true\abjad@jim@notailtrue% + \else + \abjad@jim@notailfalse + \fi} + +\newif\if@hijrical +\def\tmp@hijri{hijri} +\define@key{urdu}{calendar}[gregorian]{% + \def\@tmpa{#1}% + \ifx\@tmpa\tmp@hijri\@hijricaltrue% + \else\@hijricalfalse% + \fi} + +\define@key{urdu}{hijricorrection}[0]{% + \gdef\@hijri@correction{#1}}% + +% This should set the defaults +\setkeys{urdu}{calendar,numerals,hijricorrection} + +\def\urdugregmonth#1{\ifcase#1% + \or جنوری\or فروری\or مارچ\or اپریل\or مئی\or جون\or جولائی\or اگست\or ستمبر\or اکتوبر\or نومبر\or دسمبر\fi} + +\def\urduhijrimonth#1{\ifcase#1% + \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{urdu}{\@ensure@RTL{% +\urdunumber{\value{Hijriday}}؍\space\urduhijrimonth{\value{Hijrimonth}}\space\urdunumber{\value{Hijriyear}}}} + +\def\captionsurdu{% +\def\refname{\@ensure@RTL{حوالہ جات}}% +\def\abstractname{\@ensure@RTL{ملخّص}}% +\def\bibname{\@ensure@RTL{کتابیات}}% +\def\prefacename{\@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\thepart{\text{}}% +\def\partname{\@ensure@RTL{حصّہ}}% +\def\pagename{\@ensure@RTL{صفحہ}}% +\def\seename{\@ensure@RTL{ملاحظہ ہو}}% +\def\alsoname{\@ensure@RTL{ایضاً}}% +\def\enclname{\@ensure@RTL{منسلک}}% +\def\ccname{\@ensure@RTL{نقل}}% +\def\headtoname{\@ensure@RTL{بملاحظہ}}% +\def\proofname{\@ensure@RTL{ثبوت}}% +\def\glossaryname{\@ensure@RTL{لغت}}% +\def\sectionname{\@ensure@RTL{فصل}}% +} + +\def\dateurdu{% + \def\today{% + \if@hijrical + \Hijritoday[\@hijri@correction]% + \else + \@ensure@RTL{\urdunumber\day؍\space\urdugregmonth{\month}% + \space\urdunumber\year}% + \fi}% +} + +\def\urdunumber#1{% + \if@western@numerals + \number#1% + \else + %%FIXME use farsidigits instead??? + \protect\arabicdigits{\number#1}% + %%{\protect\addfontfeature{Mapping=arabicdigits}\number#1}% + \fi} + +\def\urdu@numbers{% + \let\@latinalph\@alph% + \let\@latinAlph\@Alph% + \let\@alph\abjad% + \let\@Alph\abjad% + } +\def\nourdu@numbers{% + \let\@alph\@latinalph% + \let\@Alph\@latinAlph% + } +\def\urdu@globalnumbers{% + \let\orig@arabic\@arabic% + \let\@arabic\urdunumber% + % For some reason \thefootnote needs to be set separately: + \renewcommand\thefootnote{\protect\urdunumber{\c@footnote}}% + } +\def\nourdu@globalnumbers{ + \let\@arabic\orig@arabic% + \renewcommand\thefootnote{\protect\number{\c@footnote}}% + } + +\def\urdu@language{\language=\l@urdu} + +\def\urdu@font{% + \@ifundefined{urdufont}{% + \@ifundefined{arabicfont}{% + \normalfontlatin% + \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt + \zf@check@ot@script{arab}% + \if@tempswa + \addfontfeature{Script=Arabic}% + \else + \PackageError{polyglossia}{^^J + The current font does not contain the Arabic script!^^J + Please define \string\arabicfont\space or \string\urdufont\space with \newfontfamily}% + \fi + \zf@check@ot@lang{URD}% + \if@tempswa\addfontfeature{Language=urdu}\fi}% + {\arabicfont% + \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt + \zf@check@ot@lang{URD}% + \if@tempswa\addfontfeature{Language=urdu}\fi}% + }% + {\urdufont}% +} + +% TODO add setup to define Sans and Mono Arabic fonts if desired +\def\urdu@font@sf{% + \@ifundefined{urdufontsf}{% +% \sffamily% FIXME +% \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt +% \zf@check@ot@script{arab}% +% \if@tempswa% +% \addfontfeature{Script=Arabic}% +% \else% + \urdu@font% +% \fi% + }% + {\urdufontsf}% +} +\def\urdu@font@tt{% + \@ifundefined{urdufonttt}{% +% \ttfamily% FIXME +% \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt +% \zf@check@ot@script{arab}% +% \if@tempswa% +% \addfontfeature{Script=Arabic}% +% \else% + \urdu@font% +% \fi% + }% + {\urdufonttt}% +} + +\def\selectnormalfonturdu{% + \let\normalfont=\urdu@font% + \let\rmfamily=\urdu@font% + \let\sffamily=\urdu@font@sf% + \let\ttfamily=\urdu@font@tt% + \def\reset@font{\normalfont}} + +\def\blockextras@urdu{% + \let\@@MakeUppercase\MakeUppercase% + \def\MakeUppercase##1{##1}% + } +\def\noextras@urdu{% + \let\MakeUppercase\@@MakeUppercase% + } +\endinput + diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-usorbian.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-usorbian.ldf index d2a4693cfd1..267e99a5f10 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-usorbian.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-usorbian.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-usorbian.ldf}[polyglossia: module for upper sorbian] \makeatletter -\def\usorbian@font{\normalfontlatin} +\def\usorbian@font{\selectfontfamilylatin} \ifx\l@uppersorbian\@undefined \ifx\l@usorbian\@undefined diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-welsh.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-welsh.ldf index a1209676285..da110307c61 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-welsh.ldf +++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-welsh.ldf @@ -1,6 +1,6 @@ \ProvidesFile{gloss-welsh.ldf}[polyglossia: module for welsh] \makeatletter -\def\welsh@font{\normalfontlatin} +\def\welsh@font{\selectfontfamilylatin} \ifx\l@welsh\@undefined% \xpg@nopatterns{Welsh}% diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/hijrical.sty b/Master/texmf-dist/tex/xelatex/polyglossia/hijrical.sty index a0320f4cb23..0492baa6275 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/hijrical.sty +++ b/Master/texmf-dist/tex/xelatex/polyglossia/hijrical.sty @@ -2,6 +2,7 @@ [2007/12/27 v0.1 % Islamic calendar] \RequirePackage{bidi} +\RequirePackage{arabicnumbers} \@ifundefined{@Remainder}{\input{cal-util.def}}{} @@ -40,11 +41,8 @@ \def\Hijridate#1#2#3{% \HijriFromGregorian{#1}{#2}{#3}% - \if@RTL% - \FormatHijriDate% - \else% - \FormatHijriDateEnglish% - \fi} + \FormatHijriDate} + % added option \Hijritoday[n] (default 0) for adjusting the date + n days \@ifundefined{@hijri@correction}{\gdef\@hijri@correction{0}}{} \newcommand\Hijritoday[1][\@hijri@correction]{% @@ -65,16 +63,22 @@ Shawwāl\or Dhū ’l-Qaʿda\or Dhū ’l-Ḥijja\fi} جمادى الأولى\or جمادى الآخرة\or رجب\or شعبان\or رمضان\or% شوال\or ذو القعدة\or ذو الحجة\fi} -\def\FormatHijriDateEnglish{% -\number\value{Hijriday}\space\HijriMonthTranslit{\value{Hijrimonth}}\space\number\value{Hijriyear}} +%% This macro is now locale-aware! +\def\FormatHijriDate{% + \@ifundefined{FormatHijriDate@\languagename}% + {\if@RTL\FormatHijriDate@defaultRTL\else\FormatHijriDate@defaultLTR\fi}% + {\csname FormatHijriDate@\languagename\endcsname}} -%FIXME : this is already in gloss-arabic -\def\@rabicnumb@r#1{\@ifundefined{arabicnumber}{{\addfontfeature{Mapping=arabicdigits} #1}}% -{\arabicnumber{#1}}} +\newcommand\DefineFormatHijriDate[2]{% + \@namedef{FormatHijriDate@#1}{#2}} -\def\FormatHijriDate{\@ensure@RTL{% -\@rabicnumb@r{\value{Hijriday}}\space\HijriMonthArabic{\value{Hijrimonth}}\space\@rabicnumb@r{\value{Hijriyear}}}} +% we provide this as a reasonable default. +% Further definitions are in polyglossia's language definition files. +\DefineFormatHijriDate{defaultRTL}{\@ensure@RTL{% +\arabicdigits{\value{Hijriday}}\space\HijriMonthArabic{\value{Hijrimonth}}\space\arabicdigits{\value{Hijriyear}}}} +\DefineFormatHijriDate{defaultLTR}{% +\number\value{Hijriday}\space\HijriMonthTranslit{\value{Hijrimonth}}\space\number\value{Hijriyear}} \endinput %TODO diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty b/Master/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty index 055e647a2ac..02889374b43 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty +++ b/Master/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty @@ -1,7 +1,8 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{polyglossia}[2009/11/20 v1.1.0 +\ProvidesPackage{polyglossia}[2010/03/23 v1.1.1 Babel replacement for XeLaTeX] \RequirePackage{etoolbox} +\RequirePackage{makecmds} \RequirePackage{fontspec} %which itself depends on xkeyval %% This is for compatibility with Babel-aware package: @@ -19,20 +20,18 @@ {#1\@gobble}} %% the \@gobble is to prevent displaying the line nr \providecommand*{\xpg@nopatterns}[1]{% \xpg@warning{No hyphenation patterns were loaded for `#1'\MessageBreak - I will use the patterns loaded for \string\language=0\MessageBreak instead}} + I will use the patterns for \string\language=\string\l@nohyphenation\space instead}} \providecommand*{\xpg@nolang}[1]{% \xpg@warning{File gloss-#1.ldf does not exist!^^J - I will nevertheless try to use hyphenation patterns for #1.}}% + I will nevertheless try to use hyphenation patterns for #1.}}% %TODO try at least to load the hyphenation patterns for #1. \def\xpg@ill@value#1#2{% \xpg@warning{Illegal value (#1) for #2}} %% use macro if defined, else warn that it is not -\def\xpg@csifdef@warn#1{% - \ifcsundef{#1}{\PackageWarning{polyglossia}{ #1 is not defined}}% - {\expandafter\protect\csname #1\endcsname}} -%% same without warning -\def\xpg@csifdef#1{\ifcsundef{#1}{\relax}{\expandafter\protect\csname #1\endcsname}} +\def\csuse@warn#1{% + \ifcsundef{#1}{\xpg@warning{ \expandafter\string\csname #1\endcsname\space is not defined}}% + {\csname #1\endcsname}} %% ensure directionality if bidi is loaded, else ignore \def\@@ensure@dir#1{\ifcsundef{@ensure@dir}{#1}{\@ensure@dir{#1}}} @@ -71,17 +70,16 @@ \if@nobreak\ifvmode\nobreak\fi\fi}% \def\@markright####1####2####3{\@temptokena{\protect\@@ensure@maindir{####1}}% \unrestored@protected@xdef\@themark{{\the\@temptokena}% - {{\protect\@@ensure@maindir{####3}}}}}} - \else%\ifx\@tmpa\opt@disabled + {\protect\@@ensure@maindir{####3}}}}} + \else \def\local@marks##1{} \xpg@info{Option: localmarks=off} - %\fi \fi } \setkeys{polyglossia}{localmarks=on} % to reset the intercharclass of a character to "normal" -\newXeTeXintercharclass\xpg@normalclass +\newXeTeXintercharclass\xpg@normalclass %TODO %% when no patterns are available, we use \l@nohyphenation, assigned to 255 %% (suggestion by Enrico Gregorio) @@ -117,17 +115,7 @@ }% {\PackageWarning{polyglossia}{gloss-#2.ldf is already loaded!}}% %% The following settings are for the default language and script: - \ifcsundef{#2@RL}{}% - {\@rlmaintrue\@rl@footnotetrue% - \let\@@oddfoot\@oddfoot% - \let\@@evenfoot\@evenfoot% - \let\@oddfoot\@@evenfoot% - \let\@evenfoot\@@oddfoot% - \let\@@oddhead\@oddhead% - \let\@@evenhead\@evenhead% - \let\@oddhead\@@evenhead% - \let\@evenhead\@@oddhead% - }% + \ifcsundef{#2@RL}{}{\@RTLmaintrue}% this tells bidi.sty that the document is RTL \AtBeginDocument{% \selectlanguage[#1]{#2}% \selectbackgroundlanguage{#2}}% @@ -140,11 +128,17 @@ \newcommand{\resetdefaultlanguage}[2][]{% \ifcsundef{#2@loaded}{% \PackageError{polyglossia}{gloss-#2.ldf is not loaded!}}% - {\def\languagename{#2}% + {\csuse{no\xpg@main@language @globalnumbers}% disable globalnumbers of previously defined default language + \csuse{noextras@\xpg@main@language}% + \def\languagename{#2}% \ifcsundef{#2@RL}{}{\@rlmaintrue\@rl@footnotetrue}% \selectlanguage[#1]{#2}% \selectbackgroundlanguage{#2}}} +\def\familytype{rm} +\gappto\rmfamily{\def\familytype{rm}} +\gappto\sffamily{\def\familytype{sf}} +\gappto\ttfamily{\def\familytype{tt}} % This saves the normalfont for the latin script since we may change normalfont in other scripts \let\normalfontlatin=\normalfont% \let\rmfamilylatin=\rmfamily% @@ -157,7 +151,20 @@ \let\ttfamily=\ttfamilylatin% \normalfontlatin} -\def\reset@LR{\xpg@csifdef{setLR}} +\def\reset@LR{\csuse{setLR}} + +\def\selectnormalfontlatin{% + \if\normalfont\ttfamily\ttfamilylatin\else + \if\normalfont\sffamily\sffamilylatin\else + \normalfontlatin\fi\fi} + +\DeclareRobustCommand\selectfontfamilylatin{% + \def\tmp@tt{tt}\def\tmp@sf{sf}% + \ifx\familytype\tmp@tt% + \ttfamilylatin% + \else\ifx\familytype\tmp@sf% + \sffamilylatin% + \else\rmfamilylatin\fi\fi} \let\@@fterindentfalse\@afterindentfalse \def\french@indent{\let\@afterindentfalse\@afterindenttrue @@ -166,8 +173,8 @@ \@afterindentfalse} \newcommand{\selectbackgroundlanguage}[1]{% - \xpg@csifdef{selectnormalfont#1}% - \xpg@csifdef{#1@globalnumbers}% + \csuse{selectnormalfont#1}% + \csuse{#1@globalnumbers}% } \newcommand{\setotherlanguage}[2][]{% @@ -186,12 +193,12 @@ \fi \expandafter\newcommand\csname text#2\endcsname[2][]{% \ifcsdef{RL}{% - \ifcsundef{#2@RL}% - {\@ensure@LTR{\foreignlanguage[####1]{#2}{####2}}}% + \ifcsundef{#2@RL}% + {\@ensure@LTR{\foreignlanguage[####1]{#2}{####2}}}% {\@ensure@RTL{\foreignlanguage[####1]{#2}{####2}}}% - }{% else + }{% else \foreignlanguage[####1]{#2}{####2}% - }}% + }}% \csletcs{local#2}{text#2}% \csgdef{#2@loaded}{}% }% @@ -209,10 +216,11 @@ \docsvlist{#1}}% \def\common@language{% - \protect\language=0% - \lefthyphenmin=2\righthyphenmin=3} + \language=\z@ + \lefthyphenmin=\tw@ + \righthyphenmin=\thr@@} -\def\noextrascurrent#1{\xpg@csifdef{noextras@#1}} +\def\noextrascurrent#1{\csuse{noextras@#1}} \def\xpg@initial@setup{\ifcsundef{languagename}{}% {\noextrascurrent{\languagename}}% @@ -220,29 +228,32 @@ \AtBeginDocument{\xpg@initial@setup} -\ifcsundef{foreignlanguage}{}% - {\let\foreignlanguage\@undefined} +\providecommand{\foreignlanguage}{} -\newcommand{\foreignlanguage}[3][]{% +\renewcommand{\foreignlanguage}[3][]{% \ifcsundef{#2@loaded}{\xpg@nolang{#2}\hyphenrules{#2}}{% {\def\languagename{#2}% \setkeys{#2}{#1}% - \xpg@csifdef@warn{#2@font}% - \xpg@csifdef@warn{#2@language}% - \xpg@csifdef{date#2}% - \xpg@csifdef{#2@numbers}% + \csuse@warn{#2@font}% + \csuse@warn{#2@language}% + \csuse{date#2}% + \csuse{#2@numbers}% \use@localhyphenmins{#2}% - \xpg@csifdef{inlineextras@#2}% + \csuse{inlineextras@#2}% #3}% -}} + }% +} -\ifcsundef{selectlanguage}{}% - {\let\selectlanguage\@undefined} +%Hook that other package authors can use +%(for instance biblatex): +\newcommand*{\xpg@hook@setlanguage}{} -\newcommand{\selectlanguage}[2][]{% +\providecommand{\selectlanguage}{} +\renewcommand{\selectlanguage}[2][]{% \ifcsundef{#2@loaded}{\xpg@nolang{#2}\hyphenrules{#2}}{% \def\xpg@pop@language{% \xpg@set@language{\languagename}% + \xpg@hook@setlanguage% \let\emp@langname\@undefined}% \aftergroup\xpg@pop@language% \setkeys{#2}{#1}% @@ -259,34 +270,28 @@ \fi } -\ifcsundef{select@language}{}% - {\let\select@language\@undefined} - -\newcommand{\select@language}[1]{% +\def\select@language#1{% \xpg@initial@setup% \edef\languagename{#1}% \ifcsundef{RL}{}% {\ifcsundef{#1@RL}{\setLR}{\setRL}}% - \xpg@csifdef@warn{#1@font}% - \xpg@csifdef@warn{#1@language}% + \csuse@warn{#1@font}% + \csuse@warn{#1@language}% \use@localhyphenmins{#1}% - \xpg@csifdef{captions#1}% - \xpg@csifdef{date#1}% - \xpg@csifdef{#1@numbers}% + \csuse{captions#1}% + \csuse{date#1}% + \csuse{#1@numbers}% \local@marks{#1}% - \xpg@csifdef{blockextras@#1}% + \csuse{blockextras@#1}% } \let\xpg@pop@language\relax -\ifcsundef{otherlanguage}{}% - {\let\otherlanguage\@undefined} -\ifcsundef{endotherlanguage}{}% - {\let\endotherlanguage\@undefined} +\provideenvironment{otherlanguage}{}{} -\newenvironment{otherlanguage}[2][]{% - \selectlanguage[#1]{#2}% - }{} +\renewenvironment{otherlanguage}[2][] + {\selectlanguage[#1]{#2}} + {} \newcommand{\setlocalhyphenmins}[3]{% \expandafter\ifx\csname l@#1\endcsname\relax% @@ -303,10 +308,41 @@ \ifcsundef{#1hyphenmins}{}% {\expandafter\expandafter\expandafter\set@hyphenmins\csname #1hyphenmins\endcsname\relax}} -%% package options - -%%\DeclareOption{shorthands}{\setkeys{polyglossia}{shorthands=true}} +% FIXME: remove this eventually, say in 2012 :) +% taken from xelatex.ini, in case the xelatex format is too old +\ifcsundef{newXeTeXintercharclass}{% + \xpg@warning{Your xelatex format appears to be outdated!^^J + Please update your system and recreate it with fmtutil.} + \newcount\xe@alloc@intercharclass % allocates intercharclass + \xe@alloc@intercharclass=\thr@@ % from 4 (1,2 and 3 are used by CJK, AFAIK) + \def\xe@alloc@#1#2#3#4#5{\global\advance#1\@ne + \xe@ch@ck#1#4#2% make sure there's still room + \allocationnumber#1% + \global#3#5\allocationnumber + \wlog{\string#5=\string#2\the\allocationnumber}} + \def\xe@ch@ck#1#2#3{% + \ifnum#1<#2\else + \errmessage{No room for a new #3}% + \fi} + \def\newXeTeXintercharclass{% + \xe@alloc@\xe@alloc@intercharclass\XeTeXintercharclass\chardef\@cclv} %at most 254 + } + {} + +%% patch lastpage to avoid problem with \thepage when \@arabic is redefined for non-Latin numbers +%\@ifpackageloaded{lastpage}{% +%\xpg@info{Redefining lastpage command \string\lastpage@putlabel}% +%\def\lastpage@putlabel{\addtocounter{page}{-1}% +% \immediate\write\@auxout{\string +% \newlabel{LastPage}{{}{\number\c@page}}}% +% \addtocounter{page}{1}}}% +% {} +% +\define@boolkey{polyglossia}[system@]{babelshorthands}[false]{} + +%% Package Options %% \DeclareOption{nolocalmarks}{\setkeys{polyglossia}{localmarks=off}} +\DeclareOption{babelshorthands}{\setkeys{polyglossia}{babelshorthands=true}} \DeclareOption{quiet}{% \gdef\@latex@info#1{\relax}% no latex info \gdef\@font@info#1{\relax}% no latex font info @@ -326,13 +362,14 @@ \DeclareOption{polygreek}{\xpg@option{variant=poly}{greek}} \DeclareOption{monogreek}{\xpg@option{variant=mono}{greek}} \DeclareOption{ancientgreek}{\xpg@option{variant=ancient}{greek}} -%%% FIXME: this does not work when gloss-