texlive[43110] Master/texmf-dist/tex/generic/tex4ht: fontspec support

commits+karl at tug.org commits+karl at tug.org
Wed Feb 1 00:47:39 CET 2017


Revision: 43110
          http://tug.org/svn/texlive?view=revision&revision=43110
Author:   karl
Date:     2017-02-01 00:47:39 +0100 (Wed, 01 Feb 2017)
Log Message:
-----------
fontspec support again, tex4ht r238, http://puszcza.gnu.org.ua/bugs/?352

Revision Links:
--------------
    http://tug.org/svn/texlive?view=revision&revision=238

Modified Paths:
--------------
    trunk/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/generic/tex4ht/usepackage-fontspec.4ht

Added: trunk/Master/texmf-dist/tex/generic/tex4ht/usepackage-fontspec.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/usepackage-fontspec.4ht	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/usepackage-fontspec.4ht	2017-01-31 23:47:39 UTC (rev 43110)
@@ -0,0 +1,105 @@
+% fontspec.4ht (2017-01-31-15:40), generated from tex4ht-4ht.tex
+% Copyright 2017 TeX Users Group
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either
+% version 1.3c of this license or (at your option) any
+% later version. The latest version of this license is in
+%   http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions
+% of LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% This Current Maintainer of this work
+% is the TeX4ht Project <tex4ht at tug.org>.
+%
+% If you modify this program, changing the
+% version identification would be appreciated.
+\immediate\write-1{version 2017-01-31-15:40}
+
+\:dontusepackage{fontenc}
+\RequirePackage{expl3}
+\append:def\config:opt{,new-accents}
+\ExplSyntaxOn
+\AtEndOfPackage{%
+  \tl_gset:Nx \l__fontspec_nfss_enc_tl {T1}
+  \tl_gset:Nx \g_fontspec_encoding_tl {T1}
+  \seq_new:N \fontspec_ht_scripts
+  \seq_new:N \fontspec_ht_fontfamilies
+  \keys_define:nn {fontspec4ht}{
+    Script .code:n = \seq_put_right:Nn \fontspec_ht_scripts {#1}
+  }
+\cs_set:Nn \fontspec_set_family:Nnn
+ {
+  % \tl_set:Nn \l__fontspec_family_label_tl { #1 }
+  % \__fontspec_select_font_family:nn {#2}{#3}
+  % \tl_set_eq:NN #1 \l_fontspec_family_tl
+  \def#1{\relax}
+ }
+
+
+\prg_set_conditional:Nnn \fontspec_if_fontspec_font: {TF,T,F}
+{
+  \prg_return_false:
+}
+
+\DeclareDocumentCommand \setmainfont { O{} m O{} }
+ {
+   % Optional argument can be in both first and third parameter
+  \keys_set_known:nn {fontspec4ht}{#1}
+  \keys_set_known:nn {fontspec4ht}{#3}
+  \seq_put_right:Nn \fontspec_ht_fontfamilies {#2}
+  \use:x { \exp_not:n { \DeclareRobustCommand \rmfamily }
+   {
+    \relax
+   }
+  }
+  \normalfont
+  \ignorespaces
+ }
+
+ % define aliases for other user commands
+\cs_set_eq:NN \fontspec\setmainfont
+\cs_set_eq:NN \setsansfont\setmainfont
+\cs_set_eq:NN \setmonofont\setmainfont
+\cs_set_eq:NN \setromanfont\setmainfont
+\cs_set_eq:NN \setmathrm\setmainfont
+\cs_set_eq:NN \setmathsf\setmainfont
+\cs_set_eq:NN \setboldmathrm\cs_set_eq:NN
+\cs_set_eq:NN \setmatht\cs_set_eq:NN
+
+
+
+\DeclareDocumentCommand \newfontfamily { m O{} m O{} }
+ {
+  % \fontspec_set_family:cnn { g__fontspec_ \cs_to_str:N #1 _family } {#2} {#3}
+  \keys_set_known:nn {fontspec4ht}{#4}
+  \seq_put_right:Nn \fontspec_ht_fontfamilies {#3}
+  \use:x
+   {
+    \exp_not:N \DeclareRobustCommand \exp_not:N #1
+     {
+       \relax
+     }
+   }
+ }
+ % \tl_set:Nn \g_fontspec_encoding_tl{T1}
+ %  \tl_set_eq:NN \encodingdefault\g_fontspec_encoding_tl
+ \DeclareDocumentCommand \addfontfeatures {m}
+ {
+   \keys_set_known:nn {fontspec4ht}{#1}
+   \typeout{Add font features}
+ }
+ \cs_set_eq:NN \addfontfeature \addfontfeatures
+  \global\expandafter\let\csname ver at fontenc.sty\endcsname\relax
+  \global\expandafter\let\csname opt at fontenc.sty\endcsname\relax
+}
+\ExplSyntaxOff
+\edef\TivhTcats{%
+  \catcode`:=12%
+  \catcode`@=\the\catcode`@%
+}
+
+\endinput
+

Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht	2017-01-31 22:46:55 UTC (rev 43109)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht	2017-01-31 23:47:39 UTC (rev 43110)
@@ -1,6 +1,6 @@
-% usepackage.4ht (2016-12-10-15:36), generated from tex4ht-4ht.tex
+% usepackage.4ht (2017-01-31-15:40), generated from tex4ht-4ht.tex
 % Copyright 2003-2009 Eitan M. Gurari
-% Copyright 2009-2016 TeX Users Group
+% Copyright 2009-2017 TeX Users Group
 %
 % This work may be distributed and/or modified under the
 % conditions of the LaTeX Project Public License, either
@@ -46,9 +46,10 @@
 
 \fi
 \def\:temp{xr-hyper}\ifx \@currname\:temp
-   \AtEndOfPackage{\let\XR:\XR@
+   \def\eat:optional[#1]{}
+\AtEndOfPackage{\let\XR:\XR@
    \def\XR@[#1]#2{%
-    \Configure{AtBeginDocument}{\XR:[#1]{#2}}{}}%
+     \Configure{AtBeginDocument}{\XR:[#1]{#2}}{}\@ifnextchar[\eat:optional{}}%
 }
 
 \fi
@@ -56,48 +57,11 @@
 \:dontusepackage{savetrees}
 \fi
 \def\:temp{fontspec}\ifx \@currname\:temp
-\:dontusepackage{fontenc}
-\RequirePackage{expl3}
-\append:def\config:opt{,new-accents}
-\ExplSyntaxOn
-\AtEndOfPackage{%
-  \tl_gset:Nx \l__fontspec_nfss_enc_tl {T1}
-  \tl_gset:Nx \g_fontspec_encoding_tl {T1}
-  \seq_new:N \fontspec_ht_scripts
-  \seq_new:N \fontspec_ht_fontfamilies
-  \keys_define:nn {fontspec4ht}{
-    Script .code:n = \seq_put_right:Nn \fontspec_ht_scripts {#1}
-  }
-  \cs_gset:Nn \__fontspec_fontspec:nn
-  {
-    % \fontspec_set_family:Nnn \f at family {#1} {#2}
-    % \selectfont
-    \ignorespaces
-  }
-  \cs_set:Nn \__fontspec_newfontfamily:Nnn
- {
-  % \fontspec_set_family:cnn { g__fontspec_ \cs_to_str:N #1 _family } {#2} {#3}
-  \keys_set_known:nn {fontspec4ht}{#2}
-  \seq_put_right:Nn \fontspec_ht_fontfamilies {#3}
-  \use:x
-   {
-    \exp_not:N \DeclareRobustCommand \exp_not:N #1
-     {
-      % \exp_not:N \fontfamily { \use:c {g__fontspec_ \cs_to_str:N #1 _family} }
-      % \exp_not:N \fontencoding { \l__fontspec_nfss_enc_tl }
-      % \exp_not:N \selectfont
-     }
-   }
- }
-  \global\expandafter\let\csname ver at fontenc.sty\endcsname\relax
-  \global\expandafter\let\csname opt at fontenc.sty\endcsname\relax
-}
-\ExplSyntaxOff
-\edef\TivhTcats{%
-  \catcode`:=12%
-  \catcode`@=\the\catcode`@%
-}
-
+  \ifdefined\fontspec
+    \:dontusepackage{fontspec}
+  \else
+    \input usepackage-fontspec.4ht
+  \fi
 \fi
 
 



More information about the tex-live-commits mailing list