| 1 |
% usepackage-fontspec.4ht (2023-10-12-14:41), generated from tex4ht-4ht.tex |
| 2 |
% Copyright 2017-2023 TeX Users Group |
| 3 |
% |
| 4 |
% This work may be distributed and/or modified under the |
| 5 |
% conditions of the LaTeX Project Public License, either |
| 6 |
% version 1.3c of this license or (at your option) any |
| 7 |
% later version. The latest version of this license is in |
| 8 |
% http://www.latex-project.org/lppl.txt |
| 9 |
% and version 1.3c or later is part of all distributions |
| 10 |
% of LaTeX version 2005/12/01 or later. |
| 11 |
% |
| 12 |
% This work has the LPPL maintenance status "maintained". |
| 13 |
% |
| 14 |
% The Current Maintainer of this work |
| 15 |
% is the TeX4ht Project <http://tug.org/tex4ht>. |
| 16 |
% |
| 17 |
% If you modify this program, changing the |
| 18 |
% version identification would be appreciated. |
| 19 |
\immediate\write-1{version 2023-10-12-14:41} |
| 20 |
|
| 21 |
% \RequirePackage{expl3}% we need to disable them before loading |
| 22 |
\ExplSyntaxOn |
| 23 |
\seq_new:N \fontspec_ht_scripts |
| 24 |
\gdef\texfourhtfontspecloaded{yes}% used to prevent subsequent loading of this file |
| 25 |
\ExplSyntaxOff |
| 26 |
\ifdefined\XeTeXversion% |
| 27 |
\xenunidelblock{Latin-expl3}% expl3 package makes some characters active |
| 28 |
\xeuniuseblock{Latin-expl3}% and define again |
| 29 |
\fi% |
| 30 |
\PassOptionsToPackage{no-math}{fontspec} |
| 31 |
\ExplSyntaxOn |
| 32 |
\:AtEndOfPackage{% |
| 33 |
\tl_gset:Ne \l__fontspec_nfss_enc_tl {T1} |
| 34 |
\tl_gset:Ne \g_fontspec_encoding_tl {T1} |
| 35 |
\tl_gset:Ne \l__fontspec_ttfamily_encoding_tl {T1} |
| 36 |
\tl_gset:Ne \l__fontspec_sffamily_encoding_tl {T1} |
| 37 |
\tl_gset:Ne \l__fontspec_rmfamily_encoding_tl {T1} |
| 38 |
\seq_new:N \fontspec_ht_fontfamilies |
| 39 |
\ifdefined\XeTeXversion |
| 40 |
\keys_define:nn {fontspec4ht}{ |
| 41 |
Script .code:n = \xeuniuseblock{#1} |
| 42 |
} |
| 43 |
\else |
| 44 |
\keys_define:nn {fontspec4ht}{ |
| 45 |
Script .code:n = \seq_put_right:Nn \fontspec_ht_scripts {#1} |
| 46 |
} |
| 47 |
\fi |
| 48 |
\cs_set:Nn \fontspec_set_family:Nnn |
| 49 |
{ |
| 50 |
% \tl_set:Nn \l__fontspec_family_label_tl { #1 } |
| 51 |
% \__fontspec_select_font_family:nn {#2}{#3} |
| 52 |
% \tl_set_eq:NN #1 \l_fontspec_family_tl |
| 53 |
\def#1{\relax} |
| 54 |
} |
| 55 |
|
| 56 |
|
| 57 |
\prg_set_conditional:Nnn \fontspec_if_fontspec_font: {TF,T,F} |
| 58 |
{ |
| 59 |
\prg_return_false: |
| 60 |
} |
| 61 |
|
| 62 |
\DeclareDocumentCommand \setmainfont { O{} m O{} } |
| 63 |
{ |
| 64 |
% Optional argument can be in both first and third parameter |
| 65 |
\keys_set_known:nn {fontspec4ht}{#1} |
| 66 |
\keys_set_known:nn {fontspec4ht}{#3} |
| 67 |
\seq_put_right:Nn \fontspec_ht_fontfamilies {#2} |
| 68 |
\use:x { \exp_not:n { \DeclareRobustCommand \rmfamily } |
| 69 |
{ |
| 70 |
\relax |
| 71 |
} |
| 72 |
} |
| 73 |
\normalfont |
| 74 |
\ignorespaces |
| 75 |
} |
| 76 |
|
| 77 |
% define aliases for other user commands |
| 78 |
\cs_set_eq:NN \fontspec\setmainfont |
| 79 |
\cs_set_eq:NN \setsansfont\setmainfont |
| 80 |
\cs_set_eq:NN \setmonofont\setmainfont |
| 81 |
\cs_set_eq:NN \setromanfont\setmainfont |
| 82 |
\cs_set_eq:NN \setmathrm\setmainfont |
| 83 |
\cs_set_eq:NN \setmathsf\setmainfont |
| 84 |
\cs_set_eq:NN \setboldmathrm\cs_set_eq:NN |
| 85 |
\cs_set_eq:NN \setmatht\cs_set_eq:NN |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
\DeclareDocumentCommand \newfontfamily { m O{} m O{} } |
| 90 |
{ |
| 91 |
% \fontspec_set_family:cnn { g__fontspec_ \cs_to_str:N #1 _family } {#2} {#3} |
| 92 |
\keys_set_known:nn {fontspec4ht}{#2} |
| 93 |
\keys_set_known:nn {fontspec4ht}{#4} |
| 94 |
\seq_put_right:Nn \fontspec_ht_fontfamilies {#3} |
| 95 |
\use:x |
| 96 |
{ |
| 97 |
\exp_not:N \DeclareRobustCommand \exp_not:N #1 |
| 98 |
{ |
| 99 |
\relax |
| 100 |
} |
| 101 |
} |
| 102 |
} |
| 103 |
% \tl_set:Nn \g_fontspec_encoding_tl{T1} |
| 104 |
% \tl_set_eq:NN \encodingdefault\g_fontspec_encoding_tl |
| 105 |
\DeclareDocumentCommand \addfontfeatures {m} |
| 106 |
{ |
| 107 |
\keys_set_known:nn {fontspec4ht}{#1} |
| 108 |
\typeout{Add font features} |
| 109 |
} |
| 110 |
\cs_set_eq:NN \addfontfeature \addfontfeatures |
| 111 |
\global\expandafter\let\csname [email protected]\endcsname\relax |
| 112 |
\global\expandafter\let\csname [email protected]\endcsname\relax |
| 113 |
} |
| 114 |
\ExplSyntaxOff |
| 115 |
\edef\TivhTcats{% |
| 116 |
\catcode`:=12% |
| 117 |
\catcode`@=\the\catcode`@% |
| 118 |
} |
| 119 |
|
| 120 |
\endinput |
| 121 |
|