diff options
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/polyglossia/gloss-thai.ldf')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/polyglossia/gloss-thai.ldf | 47 |
1 files changed, 34 insertions, 13 deletions
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 |