summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx')
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx90
1 files changed, 56 insertions, 34 deletions
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx
index 0bc6e64d130..a56503dced1 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx
@@ -1,3 +1,5 @@
+%%^^A%% fontspec-internal.dtx -- part of FONTSPEC <wspr.io/fontspec>
+
% \section{Internals}
%
% \iffalse
@@ -230,7 +232,7 @@
\@@_primitive_font_set:Nnn \l_fontspec_font
{ \@@_construct_font_call:nn { \l_@@_fontname_up_tl } {} } {\f@size pt}
\@@_primitive_font_if_null:NT \l_fontspec_font { \@@_error:nx {font-not-found} {\l_@@_fontname_up_tl} }
- \@@_set_font_type:
+ \@@_set_font_type:N \l_fontspec_font
%<debug>\typeout{Set~ base~ font~ properly: \@@_construct_font_call:nn { \l_@@_fontname_up_tl } {} }
\@@_primitive_font_gset:Nnn \l_fontspec_font
{ \@@_construct_font_call:nn { \l_@@_fontname_up_tl } {} } {\f@size pt}
@@ -298,7 +300,7 @@
{
\tl_if_empty:NTF \l_@@_script_name_tl
{
- \@@_check_script:nTF {latn}
+ \@@_check_script:NnTF \l_fontspec_font {latn}
{
\tl_set:Nn \l_@@_script_name_tl {Latin}
\tl_if_empty:NT \l_@@_lang_name_tl
@@ -351,8 +353,8 @@
% \EROROR
}
{
-%<debug> \typeout{::: Setting~ keys~ for~ AAT~ font~ features:~"\l_@@_keys_leftover_clist"}
- \bool_if:NT \l_@@_atsui_bool
+%<debug> \typeout{::: Setting~ keys~ for~ AAT/Graphite~ font~ features:~"\l_@@_keys_leftover_clist"}
+ \bool_if:nT { \l_@@_atsui_bool || \l_@@_graphite_bool }
{ \keys_set:nV {fontspec-aat} \l_@@_keys_leftover_clist }
}
%</xetexx>
@@ -390,11 +392,17 @@
%<debug> \typeout{save~ family:~ #1}
%<debug> \typeout{== fontid_tl: "\l_@@_fontid_tl".}
- \cs_if_exist:NT \l_@@_nfss_fam_tl
- {
- \cs_set_eq:cN {g_@@_UID_\l_@@_fontid_tl} \l_@@_nfss_fam_tl
- }
- \cs_if_exist:cF {g_@@_UID_\l_@@_fontid_tl}
+ \tl_if_exist:cF {g_@@_UID_\l_@@_fontid_tl}
+ {
+ \tl_new:c {g_@@_UID_\l_@@_fontid_tl}
+ }
+
+ \tl_if_exist:NT \l_@@_nfss_fam_tl
+ {
+ \tl_set_eq:cN {g_@@_UID_\l_@@_fontid_tl} \l_@@_nfss_fam_tl
+ }
+
+ \tl_if_empty:cT {g_@@_UID_\l_@@_fontid_tl}
{
% The font name is fully expanded, in case it's defined in terms of macros, before having its spaces zapped:
\tl_set:Nx \l_@@_tmp_tl {#1}
@@ -410,7 +418,7 @@
}
}
\tl_gset:Nv \l_fontspec_family_tl {g_@@_UID_\l_@@_fontid_tl}
- \cs_if_exist:cTF {g_@@_ \l_fontspec_family_tl _prop}
+ \cs_if_exist:cTF {g_@@_fontinfo_ \l_fontspec_family_tl _prop}
\prg_return_false: \prg_return_true:
}
% \end{macrocode}
@@ -435,18 +443,18 @@
% \begin{macrocode}
\cs_new:Nn \@@_save_fontinfo:n
{
- \prop_new:c {g_@@_ \l_fontspec_family_tl _prop}
- \prop_gput:cnx {g_@@_ \l_fontspec_family_tl _prop} {fontname} { #1 }
- \prop_gput:cnx {g_@@_ \l_fontspec_family_tl _prop} {options} { \l_@@_all_features_clist }
- \prop_gput:cnx {g_@@_ \l_fontspec_family_tl _prop} {fontdef}
+ \prop_new:c {g_@@_fontinfo_ \l_fontspec_family_tl _prop}
+ \prop_gput:cnx {g_@@_fontinfo_ \l_fontspec_family_tl _prop} {fontname} { #1 }
+ \prop_gput:cnx {g_@@_fontinfo_ \l_fontspec_family_tl _prop} {options} { \l_@@_all_features_clist }
+ \prop_gput:cnx {g_@@_fontinfo_ \l_fontspec_family_tl _prop} {fontdef}
{
\@@_construct_font_call:nn {\l_fontspec_fontname_tl}
{ \l_@@_pre_feat_sclist \l_@@_rawfeatures_sclist }
}
- \prop_gput:cnV {g_@@_ \l_fontspec_family_tl _prop} {script-num} \l_@@_script_int
- \prop_gput:cnV {g_@@_ \l_fontspec_family_tl _prop} {lang-num} \l_@@_language_int
- \prop_gput:cnV {g_@@_ \l_fontspec_family_tl _prop} {script-tag} \l_fontspec_script_tl
- \prop_gput:cnV {g_@@_ \l_fontspec_family_tl _prop} {lang-tag} \l_fontspec_lang_tl
+ \prop_gput:cnV {g_@@_fontinfo_ \l_fontspec_family_tl _prop} {script-num} \l_@@_script_int
+ \prop_gput:cnV {g_@@_fontinfo_ \l_fontspec_family_tl _prop} {lang-num} \l_@@_language_int
+ \prop_gput:cnV {g_@@_fontinfo_ \l_fontspec_family_tl _prop} {script-tag} \l_fontspec_script_tl
+ \prop_gput:cnV {g_@@_fontinfo_ \l_fontspec_family_tl _prop} {lang-tag} \l_fontspec_lang_tl
}
% \end{macrocode}
% \end{macro}
@@ -549,7 +557,7 @@
%
% \subsubsection{Fonts}
%
-% \begin{macro}{\@@_set_font_type:}
+% \begin{macro}{\@@_set_font_type:N}
% Now check if the font is to be rendered with \ATSUI\ or Harfbuzz. This will either
% be automatic (based on the font type), or specified by the user via a font feature.
%
@@ -558,7 +566,7 @@
% font or an OpenType font or a font with feature axes (either \AAT\ or
% Multiple Master), respectively.
% \begin{macrocode}
-\cs_new:Nn \@@_set_font_type:
+\cs_new:Nn \@@_set_font_type:N
{
%<debug> \typeout{:: @@_set_font_type:}
%<*xetexx>
@@ -567,32 +575,30 @@
\bool_set_false:N \l_@@_ot_bool
\bool_set_false:N \l_@@_mm_bool
\bool_set_false:N \l_@@_graphite_bool
- \ifcase\XeTeXfonttype\l_fontspec_font
+ \ifcase\XeTeXfonttype #1
\bool_set_true:N \l_@@_tfm_bool
\or
\bool_set_true:N \l_@@_atsui_bool
- \ifnum\XeTeXcountvariations\l_fontspec_font > \c_zero
+ \tl_if_empty:NT \l_fontspec_renderer_tl { \tl_set:Nn \l_fontspec_renderer_tl {/AAT} }
+ \ifnum\XeTeXcountvariations #1 > \c_zero
\bool_set_true:N \l_@@_mm_bool
\fi
\or
\bool_set_true:N \l_@@_ot_bool
+ \tl_if_empty:NT \l_fontspec_renderer_tl { \tl_set:Nn \l_fontspec_renderer_tl {/OT} }
+ \or
+ \bool_set_true:N \l_@@_graphite_bool
+ \tl_if_empty:NT \l_fontspec_renderer_tl { \tl_set:Nn \l_fontspec_renderer_tl {/GR} }
\fi
+%</xetexx>
% \end{macrocode}
% If automatic, the \cmd{\l_fontspec_renderer_tl} token list will still be
% empty (other suffices that could be added will be later in the feature
% processing), and if it is indeed still empty, assign it a value so that the
% other weights of the font are specifically loaded with the same renderer.
+%
+% LuaTeX only supports one:
% \begin{macrocode}
- \tl_if_empty:NT \l_fontspec_renderer_tl
- {
- \bool_if:NTF \l_@@_atsui_bool
- { \tl_set:Nn \l_fontspec_renderer_tl {/AAT} }
- {
- \bool_if:NT \l_@@_ot_bool
- { \tl_set:Nn \l_fontspec_renderer_tl {/OT} }
- }
- }
-%</xetexx>
%<*luatex>
\bool_set_true:N \l_@@_ot_bool
%</luatex>
@@ -916,7 +922,7 @@
%<luatex>\cs_set:Nn \@@_make_smallcaps:TF
%<xetexx>\cs_set:Nn \@@_make_ot_smallcaps:TF
{
- \@@_check_ot_feat:nTF {smcp} {#1} {#2}
+ \@@_check_ot_feat:NnTF \l_fontspec_font {smcp} {#1} {#2}
}
%<*xetexx>
\cs_set:Nn \@@_make_smallcaps:TF
@@ -925,7 +931,7 @@
{ \@@_make_ot_smallcaps:TF {#1} {#2} }
{
\bool_if:NT \l_@@_atsui_bool
- { \@@_make_AAT_feature_string:nnTF {3}{3} {#1} {#2} }
+ { \@@_make_AAT_feature_string:NnnTF \l_fontspec_font {3}{3} {#1} {#2} }
}
}
%</xetexx>
@@ -1060,3 +1066,19 @@
%</fontspec&(xetexx|luatex)>
% \end{macrocode}
% \fi
+
+
+\endinput
+
+% /©
+% ------------------------------------------------
+% The FONTSPEC package <wspr.io/fontspec>
+% ------------------------------------------------
+% Copyright 2004-2017 Will Robertson, LPPL "maintainer"
+% Copyright 2009-2013 Khaled Hosny
+% ------------------------------------------------
+% This package is free software and may be redistributed and/or modified under
+% the conditions of the LaTeX Project Public License, version 1.3c or higher
+% (your choice): <http://www.latex-project.org/lppl/>.
+% ------------------------------------------------
+% ©/