From 5fbdfcab78ba7e1bbb32f4e9b1db06f68d6f3de4 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Tue, 27 Oct 2020 20:53:05 +0000
Subject: babel (27oct20)

git-svn-id: svn://tug.org/texlive/trunk@56784 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/generic/babel/luababel.def | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

(limited to 'Master/texmf-dist/tex/generic/babel/luababel.def')

diff --git a/Master/texmf-dist/tex/generic/babel/luababel.def b/Master/texmf-dist/tex/generic/babel/luababel.def
index 66f08305448..840b6369e76 100644
--- a/Master/texmf-dist/tex/generic/babel/luababel.def
+++ b/Master/texmf-dist/tex/generic/babel/luababel.def
@@ -462,7 +462,9 @@
             node.insert_before(head, item, n)
           end
 
-          quad = font.getfont(item.font).size
+          if font.getfont(item.font) then
+            quad = font.getfont(item.font).size
+          end
           last_class = class
           last_lang = lang
         else % if penalty, glue or anything else
@@ -560,9 +562,9 @@
 \newcommand\babelfont[2][]{%  1=langs/scripts 2=fam
   \bbl@foreach{#1}{%
     \expandafter\ifx\csname date##1\endcsname\relax
-    \IfFileExists{babel-##1.tex}%
-      {\babelprovide{##1}}%
-      {}%
+      \IfFileExists{babel-##1.tex}%
+        {\babelprovide{##1}}%
+        {}%
     \fi}%
   \edef\bbl@tempa{#1}%
   \def\bbl@tempb{#2}%  Used by \bbl@bblfont
@@ -630,7 +632,7 @@
     \bbl@ifunset{bbl@##1dflt@\languagename}%
       {\bbl@cs{famrst@##1}%
        \global\bbl@csarg\let{famrst@##1}\relax}%
-      {\bbl@exp{% order is relevant
+      {\bbl@exp{% order is relevant. TODO: but sometimes wrong!
          \\\bbl@add\\\originalTeX{%
            \\\bbl@font@rst{\bbl@cl{##1dflt}}%
                           \<##1default>\<##1family>{##1}}%
@@ -672,9 +674,13 @@
   \ifin@
     \bbl@exp{\\\bbl@fontspec@set\\#1\expandafter\@gobbletwo#1\\#3}%
   \fi
-  \bbl@exp{%
+  \bbl@exp{%              'Unprotected' macros return prev values
     \def\\#2{#1}%         eg, \rmdefault{\bbl@rmdflt@lang}
-    \\\bbl@ifsamestring{#2}{\f@family}{\\#3\let\\\bbl@tempa\relax}{}}}
+    \\\bbl@ifsamestring{#2}{\f@family}%
+      {\\#3%
+       \\\bbl@ifsamestring{\f@series}{\bfdefault}{\\\bfseries}{}%
+       \let\\\bbl@tempa\relax}%
+      {}}}
 \def\bbl@fontspec@set#1#2#3#4{% eg \bbl@rmdflt@lang fnt-opt fnt-nme \xxfamily
   \let\bbl@tempe\bbl@mapselect
   \let\bbl@mapselect\relax
@@ -1481,7 +1487,6 @@ end
      \babelsublr{%
        \LaTeX\kern.15em2\bbl@nextfake$_{\textstyle\varepsilon}$}}}}
   {}
-
 \endinput
 %%
 %% End of file `luababel.def'.
-- 
cgit v1.2.3

