]> git.lyx.org Git - features.git/commitdiff
Fix font substitutions of Thai documents
authorScott Kostyshak <skostysh@lyx.org>
Fri, 18 Aug 2023 02:02:09 +0000 (22:02 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Fri, 18 Aug 2023 02:17:02 +0000 (22:17 -0400)
The substitutefont package is obsoleted now on TL because the
required functionality is in the kernel. See here:

  https://ctan.org/pkg/substitutefont

lib/languages

index 3101ee3990aba31997803c2ffe04cdec1a814a9f..760a1ff64086cbd3306c9829d63957601534d798 100644 (file)
@@ -1522,11 +1522,23 @@ Language thai
          \DeclareRobustCommand{\copyright}{%
            \ifmmode{\nfss@text{\textcopyright}}\else\textcopyright\fi}
          \DeclareTextSymbol{\textcopyright}{LTH}{8}
+         %
           % set up Thai fonts as substitue for the default families
-          \usepackage{substitutefont}
-          \substitutefont{LTH}{\rmdefault}{norasi}
-          \substitutefont{LTH}{\sfdefault}{garuda}
-          \substitutefont{LTH}{\ttdefault}{ttypist}
+         % The 'substitutefont' package is obsolete now, since commands
+         % from the LaTeX kernel can be used instead. See here:
+         %   https://ctan.org/pkg/substitutefont
+         %   https://www.latex-project.org/news/latex2e-news/ltnews31.pdf
+         \providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
+         \IfFormatAtLeastTF{2020/02/01}{%
+           \DeclareFontFamilySubstitution{LTH}{\rmdefault}{norasi}
+           \DeclareFontFamilySubstitution{LTH}{\sfdefault}{garuda}
+           \DeclareFontFamilySubstitution{LTH}{\ttdefault}{ttypist}
+         }{%
+           \usepackage{substitutefont}
+           \substitutefont{LTH}{\rmdefault}{norasi}
+           \substitutefont{LTH}{\sfdefault}{garuda}
+           \substitutefont{LTH}{\ttdefault}{ttypist}
+         }
        EndPostBabelPreamble
 End