[tex4ht-commits] [SCM] tex4ht updated: r238 - trunk/lit

michal_h21 at gnu.org.ua michal_h21 at gnu.org.ua
Tue Jan 31 17:43:03 CET 2017


Author: michal_h21
Date: 2017-01-31 18:43:03 +0200 (Tue, 31 Jan 2017)
New Revision: 238

Modified:
   trunk/lit/ChangeLog
   trunk/lit/Makefile
   trunk/lit/tex4ht-4ht.tex
Log:
New fontspec configurations

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2017-01-29 18:20:42 UTC (rev 237)
+++ trunk/lit/ChangeLog	2017-01-31 16:43:03 UTC (rev 238)
@@ -1,3 +1,9 @@
+2017-01-31  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-4ht.tex (usepackage.4ht, 
+	usepackage-fontspec.4ht): New configurations for Fonspec package, 
+	it should fix LuaLaTeX and XeLaTeX issues.
+
 2017-01-29  Karl Berry  <karl at freefriends.org>
 
 	* common-info.tex,

Modified: trunk/lit/Makefile
===================================================================
--- trunk/lit/Makefile	2017-01-29 18:20:42 UTC (rev 237)
+++ trunk/lit/Makefile	2017-01-31 16:43:03 UTC (rev 238)
@@ -37,7 +37,8 @@
   memoir.4ht multicol.4ht multirow.4ht nameref.4ht quoting.4ht reading.4ht \
   scrartcl.4ht scrbook.4ht scrreprt.4ht spanish.4ht subscript.4ht \
   titlesec.4ht tocloft.4ht tuenc-luatex.4ht tuenc-xetex.4ht \
-  usepackage.4ht wrapfig.4ht xcolor.4ht xr.4ht xr-hyper.4ht 
+  usepackage.4ht usepackage-fontspec.4ht wrapfig.4ht xcolor.4ht  xr.4ht \
+	xr-hyper.4ht 
 	
 # xx and many, many more.
 

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2017-01-29 18:20:42 UTC (rev 237)
+++ trunk/lit/tex4ht-4ht.tex	2017-01-31 16:43:03 UTC (rev 238)
@@ -3520,8 +3520,27 @@
 \<use package\><<<
 fontspec,>>>
 
+The defintions for fontspec are rather big, we moved them to standalone file
+to save some time in package checking.
+
+We also  want to load fontspec only once, it fails with Polyglossia otherwise.
+
 \<add to usepackage\><<<
 \def\:temp{fontspec}\ifx \@currname\:temp
+  \ifdefined\fontspec
+    \:dontusepackage{fontspec}
+  \else 
+    \input usepackage-fontspec.4ht
+  \fi
+\fi
+>>>
+
+The actual configurations which are used when fontspec is loaded:
+
+\<usepackage-fontspec.4ht\><<<
+% fontspec.4ht (|version), generated from |jobname.tex
+% Copyright 2017 TeX Users Group
+|<TeX4ht license text|>
 \:dontusepackage{fontenc}
 \RequirePackage{expl3}
 \append:def\config:opt{,new-accents}
@@ -3534,34 +3553,75 @@
   \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_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
+   }
   }
-  \cs_set:Nn \__fontspec_newfontfamily:Nnn
+  \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}{#2}
+  \keys_set_known:nn {fontspec4ht}{#4}
   \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
+       \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
 |<Restore TivhTcats|>
-\fi
->>>
+\endinput
+>>>\AddFile{9}{usepackage-fontspec}
 
 I am not really sure what is the problem here, but I've found that use of
 Expl3 package in fontspec patch causes catcode problems in packages which
@@ -3574,7 +3634,7 @@
   \catcode`:=12%
   \catcode`@=\the\catcode`@%
 } 
->>>
+>>> 
 
 We need to add support for utf-8 input. Different methods are used for LuaTeX
 and XeTeX. In LuaTeX, node callbacks are used, in XeTeX, all used characters



More information about the tex4ht-commits mailing list