diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel/babel.def')
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/babel.def | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/babel.def b/Master/texmf-dist/tex/generic/babel/babel.def index 87b4bc87125..d26dea6ff9c 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.def +++ b/Master/texmf-dist/tex/generic/babel/babel.def @@ -41,7 +41,7 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{babel.def}[2018/09/26 3.24 Babel common definitions] +\ProvidesFile{babel.def}[2018/10/03 3.25 Babel common definitions] \ifx\AtBeginDocument\@undefined \input plain.def\relax \fi @@ -1314,6 +1314,8 @@ \let\bbl@KVP@hyphenrules\@nil \let\bbl@KVP@mapfont\@nil \let\bbl@KVP@maparabic\@nil + \let\bbl@KVP@intraspace\@nil + \let\bbl@KVP@intrapenalty\@nil \bbl@forkv{#1}{\bbl@csarg\def{KVP@##1}{##2}}% TODO - error handling \ifx\bbl@KVP@import\@nil\else \bbl@exp{\\\bbl@ifblank{\bbl@KVP@import}}% @@ -1345,12 +1347,14 @@ \\\foreignlanguage{\languagename}% {####1}}}}% {}% + % To override script and language names \ifx\bbl@KVP@script\@nil\else \bbl@csarg\edef{sname@#2}{\bbl@KVP@script}% \fi \ifx\bbl@KVP@language\@nil\else \bbl@csarg\edef{lname@#2}{\bbl@KVP@language}% \fi + % For bidi texts, to switch the language based on direction \ifx\bbl@KVP@mapfont\@nil\else \bbl@ifsamestring{\bbl@KVP@mapfont}{direction}{}% {\bbl@error{Option `\bbl@KVP@mapfont' unknown for\\% @@ -1366,13 +1370,16 @@ \let\bbl@mapselect\relax \edef\bbl@prefontid{\fontid\font}}% \def\bbl@mapdir##1{% - {\def\languagename{##1}\bbl@switchfont + {\def\languagename{##1}% + \let\bbl@ifrestoring\@firstoftwo % avoid font warning + \bbl@switchfont \directlua{Babel.fontmap [\the\csname bbl@wdir@##1\endcsname]% [\bbl@prefontid]=\fontid\font}}}% \fi \bbl@exp{\\\bbl@add\\\bbl@mapselect{\\\bbl@mapdir{\languagename}}}% \fi + % For Southeast Asian, if interspace in ini \ifcase\bbl@engine\or \bbl@ifunset{bbl@intsp@\languagename}{}% {\expandafter\ifx\csname bbl@intsp@\languagename\endcsname\@empty\else @@ -1398,8 +1405,30 @@ \expandafter\bbl@intrapenalty\bbl@KVP@intrapenalty\@@ \fi}% \or - %% TODO - xetex + \bbl@ifunset{bbl@intsp@\languagename}{}% + {\expandafter\ifx\csname bbl@intsp@\languagename\endcsname\@empty\else + \ifx\bbl@KVP@intraspace\@nil + \bbl@exp{% + \\\bbl@intraspace\bbl@cs{intsp@\languagename}\\\@@}% + \fi + \ifx\bbl@KVP@intrapenalty\@nil + \bbl@intrapenalty0\@@ + \fi + \fi + \ifx\bbl@KVP@intraspace\@nil\else % We may override the ini + \expandafter\bbl@intraspace\bbl@KVP@intraspace\@@ + \fi + \ifx\bbl@KVP@intrapenalty\@nil\else + \expandafter\bbl@intrapenalty\bbl@KVP@intrapenalty\@@ + \fi + \ifx\bbl@ispacesize\@undefined + \AtBeginDocument{% + \expandafter\bbl@add + \csname selectfont \endcsname{\bbl@ispacesize}}% + \def\bbl@ispacesize{\bbl@cs{xeisp@\bbl@cs{sbcp@\languagename}}}% + \fi}% \fi + % Native digits, if provided in ini \ifcase\bbl@engine\else \bbl@ifunset{bbl@dgnat@\languagename}{}% {\expandafter\ifx\csname bbl@dgnat@\languagename\endcsname\@empty\else @@ -1416,6 +1445,7 @@ \fi \fi}% \fi + % To load or reaload the babel-*.tex, if require.babel in ini \bbl@ifunset{bbl@rqtex@\languagename}{}% {\expandafter\ifx\csname bbl@rqtex@\languagename\endcsname\@empty\else \let\BabelBeforeIni\@gobbletwo @@ -1708,13 +1738,7 @@ \bbl@csarg\bbl@add@list{lsys@#1}{Script=\bbl@cs{sname@#1}}% \bbl@ifunset{bbl@lname@#1}{}% {\bbl@csarg\bbl@add@list{lsys@#1}{Language=\bbl@cs{lname@#1}}}% - \bbl@csarg\bbl@toglobal{lsys@#1}% - \bbl@exp{% TODO - should be global, but even local does its job - % I'm still not sure -- must investigate - \<keys_if_exist:nnF>{fontspec-opentype}{Script/\bbl@cs{sname@#1}}% - {\\\newfontscript{\bbl@cs{sname@#1}}{\bbl@cs{sotf@#1}}}% - \<keys_if_exist:nnF>{fontspec-opentype}{Language/\bbl@cs{lname@#1}}% - {\\\newfontlanguage{\bbl@cs{lname@#1}}{\bbl@cs{lotf@#1}}}}} + \bbl@csarg\bbl@toglobal{lsys@#1}} \def\bbl@ini@ids#1{% \def\BabelBeforeIni##1##2{% \begingroup |