summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/babel/bbunicode.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/babel/bbunicode.dtx')
-rw-r--r--Master/texmf-dist/source/latex/babel/bbunicode.dtx50
1 files changed, 49 insertions, 1 deletions
diff --git a/Master/texmf-dist/source/latex/babel/bbunicode.dtx b/Master/texmf-dist/source/latex/babel/bbunicode.dtx
index 79677ae1edb..78a4d817f71 100644
--- a/Master/texmf-dist/source/latex/babel/bbunicode.dtx
+++ b/Master/texmf-dist/source/latex/babel/bbunicode.dtx
@@ -58,12 +58,58 @@
% \GetFileInfo{bbunicode.dtx}
% \StopEventually{}
%
+% \section{Tentative font handling}
+%
+% A general solution is far from trivial:
+% \begin{itemize}
+% \item |\addfontfeature| only sets it for the current family and it's
+% not very efficient, and
+% \item |\defaultfontfeatures| requires to redefine the font (and the
+% opti\texttt{}ons aren't ``orthogonal'').
+% \end{itemize}
+%
+%<<*Font selection>>
+\def\babelFSstore#1{%
+ \bbl@for\bbl@tempa{#1}{%
+ \edef\bbl@tempb{\noexpand\bbl@FSstore{\bbl@tempa}}
+ \bbl@tempb{rm}\rmdefault\bbl@save@rmdefault
+ \bbl@tempb{sf}\sfdefault\bbl@save@sfdefault
+ \bbl@tempb{tt}\ttdefault\bbl@save@ttdefault}}
+\def\bbl@FSstore#1#2#3#4{%
+ \bbl@csarg\edef{#2default#1}{#3}%
+ \expandafter\addto\csname extras#1\endcsname{%
+ \let#4#3%
+ \ifx#3\f@family
+ \edef#3{\csname bbl@#2default#1\endcsname}%
+ \fontfamily{#3}\selectfont
+ \else
+ \edef#3{\csname bbl@#2default#1\endcsname}%
+ \fi}%
+ \expandafter\addto\csname noextras#1\endcsname{%
+ \ifx#3\f@family
+ \fontfamily{#4}\selectfont
+ \fi
+ \let#3#4}}
+\let\bbl@langfeatures\@empty
+\def\babelFSfeatures{%
+ \let\bbl@ori@fontspec\fontspec
+ \renewcommand\fontspec[1][]{%
+ \bbl@ori@fontspec[\bbl@langfeatures##1]}
+ \let\babelFSfeatures\bbl@FSfeatures
+ \babelFSfeatures}
+\def\bbl@FSfeatures#1#2{%
+ \expandafter\addto\csname extras#1\endcsname{%
+ \babel@save\bbl@langfeatures
+ \edef\bbl@langfeatures{#2,}}}
+%<</Font selection>>
+%
% \section{Hooks for XeTeX and LuaTeX}
%
% \subsection{XeTeX}
%
% Unfortunately, the current encoding cannot be retrieved and
-% therefore it is reset always to |utf8|, which seems a sensible default.
+% therefore it is reset always to |utf8|, which seems a sensible
+% default.
% \begin{macrocode}
%<*xetex>
\def\BabelStringsDefault{unicode}
@@ -79,6 +125,7 @@
\AddBabelHook{xetex}{stopcommands}{%
\xebbl@stop
\let\xebbl@stop\relax}
+<@Font selection@>
%</xetex>
% \end{macrocode}
% \subsection{LuaTeX}
@@ -158,6 +205,7 @@
\input #1\relax
\fi
\directlua{processnow = nil}}
+<@Font selection@>
%</luatex>
% \end{macrocode}
%