diff options
author | Karl Berry <karl@freefriends.org> | 2019-09-27 21:26:38 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-09-27 21:26:38 +0000 |
commit | 7bed24813daab3ed3c3064781cb74cf8081adb4d (patch) | |
tree | 48e3b4ff0bef8fc25eeb0cb3e612c4d5b4d4388b /Master/texmf-dist/tex/generic/babel/luababel.def | |
parent | 1d47bb1c83bdddf2d3ea784a0915f0227a2769da (diff) |
babel (27sep19)
git-svn-id: svn://tug.org/texlive/trunk@52194 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel/luababel.def')
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/luababel.def | 83 |
1 files changed, 68 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/luababel.def b/Master/texmf-dist/tex/generic/babel/luababel.def index 69f0adfe3aa..2508b19f91b 100644 --- a/Master/texmf-dist/tex/generic/babel/luababel.def +++ b/Master/texmf-dist/tex/generic/babel/luababel.def @@ -490,19 +490,24 @@ \input #1\relax} \ifx\DisableBabelHook\@undefined\endinput\fi \AddBabelHook{babel-fontspec}{afterextras}{\bbl@switchfont} +\AddBabelHook{babel-fontspec}{beforestart}{\bbl@ckeckstdfonts} \DisableBabelHook{babel-fontspec} \bbl@trace{Font handling with fontspec} \@onlypreamble\babelfont \newcommand\babelfont[2][]{% 1=langs/scripts 2=fam \edef\bbl@tempa{#1}% - \def\bbl@tempb{#2}% + \def\bbl@tempb{#2}% Used by \bbl@bblfont \ifx\fontspec\@undefined \usepackage{fontspec}% \fi \EnableBabelHook{babel-fontspec}% Just calls \bbl@switchfont \bbl@bblfont} -\newcommand\bbl@bblfont[2][]{% 1=features 2=fontname - \bbl@ifunset{\bbl@tempb family}{\bbl@providefam{\bbl@tempb}}{}% +\newcommand\bbl@bblfont[2][]{% 1=features 2=fontname, @font=rm|sf|tt + \bbl@ifunset{\bbl@tempb family}% + {\bbl@providefam{\bbl@tempb}}% + {\bbl@exp{% + \\\bbl@sreplace\<\bbl@tempb family >% + {\@nameuse{\bbl@tempb default}}{\<\bbl@tempb default>}}}% % For the default font, just in case: \bbl@ifunset{bbl@lsys@\languagename}{\bbl@provide@lsys{\languagename}}{}% \expandafter\bbl@ifblank\expandafter{\bbl@tempa}% @@ -521,7 +526,18 @@ \\\not@math@alphabet\<#1family>\relax \\\fontfamily\<#1default>\\\selectfont}% \\\DeclareTextFontCommand{\<text#1>}{\<#1family>}}} -\def\bbl@switchfont{% +\def\bbl@nostdfont#1{% + \bbl@ifunset{bbl@WFF@\f@family}% + {\bbl@csarg\gdef{WFF@\f@family}{}% Flag, to avoid dupl warns + \bbl@warning{The current font is not a babel standard family:\\% + #1% + \fontname\font\\% + There is nothing intrinsically wrong with it, but\\% + 'babel' will no set Script and Language. Consider\\% + defining a new family with \string\babelfont.\\% + Reported}} + {}}% +\gdef\bbl@switchfont{% \bbl@ifunset{bbl@lsys@\languagename}{\bbl@provide@lsys{\languagename}}{}% \bbl@exp{% eg Arabic -> arabic \lowercase{\edef\\\bbl@tempa{\bbl@cs{sname@\languagename}}}}% @@ -537,12 +553,7 @@ \global\let\<bbl@##1dflt@\languagename>% \<bbl@##1dflt@*\bbl@tempa>}}}% {}}% 1=T - language, already defined - \def\bbl@tempa{% - \bbl@warning{The current font is not a standard family:\\% - \fontname\font\\% - Script and Language are not applied. Consider\\% - defining a new family with \string\babelfont.\\% - Reported}}% + \def\bbl@tempa{\bbl@nostdfont{}}% \bbl@foreach\bbl@font@fams{% don't gather with prev for \bbl@ifunset{bbl@##1dflt@\languagename}% {\bbl@cs{famrst@##1}% @@ -554,6 +565,34 @@ \\\bbl@font@set\<bbl@##1dflt@\languagename>% the main part! \<##1default>\<##1family>}}}% \bbl@ifrestoring{}{\bbl@tempa}}% +\ifx\f@family\@undefined\else % if latex + \ifcase\bbl@engine % if pdftex + \let\bbl@ckeckstdfonts\relax + \else + \def\bbl@ckeckstdfonts{% + \begingroup + \global\let\bbl@ckeckstdfonts\relax + \let\bbl@tempa\@empty + \bbl@foreach\bbl@font@fams{% + \bbl@ifunset{bbl@##1dflt@}% + {\@nameuse{##1family}% + \bbl@csarg\gdef{WFF@\f@family}{}% Flag + \bbl@exp{\\\bbl@add\\\bbl@tempa{* \<##1family> / \f@family\\\\% + \space\space\fontname\font\\\\}}% + \bbl@csarg\xdef{##1dflt@}{\f@family}% + \expandafter\xdef\csname ##1default\endcsname{\f@family}}% + {}}% + \ifx\bbl@tempa\@empty\else + \bbl@warning{The following fonts are not babel standard families:\\% + \bbl@tempa + There is nothing intrinsically wrong with it, but\\% + 'babel' will no set Script and Language. Consider\\% + defining a new family with \string\babelfont.\\% + Reported}% + \fi + \endgroup} + \fi +\fi \def\bbl@font@set#1#2#3{% eg \bbl@rmdflt@lang \rmdefault \rmfamily \bbl@xin@{<>}{#1}% \ifin@ @@ -724,7 +763,8 @@ \noindent\box\@tempboxa} \fi \IfBabelLayout{tabular} - {\bbl@replace\@tabular{$}{\bbl@nextfake$}% + {\let\bbl@OL@@tabular\@tabular + \bbl@replace\@tabular{$}{\bbl@nextfake$}% \let\bbl@tabular\@tabular \AtBeginDocument{% \ifx\bbl@tabular\@tabular\else @@ -732,7 +772,8 @@ \fi}} {} \IfBabelLayout{lists} - {\bbl@sreplace\list{\parshape}{\bbl@listparshape}% + {\let\bbl@OL@list\list + \bbl@sreplace\list{\parshape}{\bbl@listparshape}% \def\bbl@listparshape#1#2#3{% \parshape #1 #2 #3 % \ifnum\bbl@getluadir{page}=\bbl@getluadir{par}\else @@ -748,6 +789,8 @@ \textdir TLT\relax \def\bbl@pictresetdir{\textdir TRT\relax}% \fi}% + \let\bbl@OL@@picture\@picture + \let\bbl@OL@put\put \bbl@sreplace\@picture{\hskip-}{\bbl@pictsetdir\hskip-}% \def\put(#1,#2)#3{% Not easy to patch. Better redefine. \@killglue @@ -755,21 +798,28 @@ \hb@xt@\z@{\kern#1\unitlength{\bbl@pictresetdir#3}\hss}}% \AtBeginDocument {\ifx\tikz@atbegin@node\@undefined\else + \let\bbl@OL@pgfpicture\pgfpicture \bbl@sreplace\pgfpicture{\pgfpicturetrue}{\bbl@pictsetdir\pgfpicturetrue}% \bbl@add\pgfsys@beginpicture{\bbl@pictsetdir}% \bbl@add\tikz@atbegin@node{\bbl@pictresetdir}% \fi}} {} \IfBabelLayout{counters}% - {\bbl@sreplace\@textsuperscript{\m@th}{\m@th\mathdir\pagedir}% + {\let\bbl@OL@@textsuperscript\@textsuperscript + \bbl@sreplace\@textsuperscript{\m@th}{\m@th\mathdir\pagedir}% \let\bbl@latinarabic=\@arabic + \let\bbl@OL@@arabic\@arabic \def\@arabic#1{\babelsublr{\bbl@latinarabic#1}}% \@ifpackagewith{babel}{bidi=default}% {\let\bbl@asciiroman=\@roman + \let\bbl@OL@@roman\@roman \def\@roman#1{\babelsublr{\ensureascii{\bbl@asciiroman#1}}}% \let\bbl@asciiRoman=\@Roman + \let\bbl@OL@@roman\@Roman \def\@Roman#1{\babelsublr{\ensureascii{\bbl@asciiRoman#1}}}% + \let\bbl@OL@labelenumii\labelenumii \def\labelenumii{)\theenumii(}% + \let\bbl@OL@p@enumiii\p@enumiii \def\p@enumiii{\p@enumii)\theenumii(}}{}}{} \bbl@trace{Bidi footnotes} \ifx\bbl@beforeforeign\leavevmode @@ -817,12 +867,15 @@ {\bbl@exp{\\\bbl@footnotetext{\\\foreignlanguage{#2}}}{#3}{#4}}}} \fi \IfBabelLayout{footnotes}% - {\BabelFootnote\footnote\languagename{}{}% + {\let\bbl@OL@footnote\footnote + \BabelFootnote\footnote\languagename{}{}% \BabelFootnote\localfootnote\languagename{}{}% \BabelFootnote\mainfootnote{}{}{}} {} \IfBabelLayout{extras}% - {\bbl@sreplace\underline{$\@@underline}{\bbl@nextfake$\@@underline}% + {\let\bbl@OL@underline\underline + \bbl@sreplace\underline{$\@@underline}{\bbl@nextfake$\@@underline}% + \let\bbl@OL@LaTeX2e\LaTeX2e \DeclareRobustCommand{\LaTeXe}{\mbox{\m@th \if b\expandafter\@car\f@series\@nil\boldmath\fi \babelsublr{% |