diff options
author | Karl Berry <karl@freefriends.org> | 2019-02-12 22:04:13 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-02-12 22:04:13 +0000 |
commit | a737da09d5024f98cc47c98db5805e1132a55f37 (patch) | |
tree | ab5404964bc7bd53e65237b3254d419a593c8036 /Master/texmf-dist/tex/latex/fontspec | |
parent | 73c46da967e396166213cc768463e9414bb69694 (diff) |
fontspec (12feb19)
git-svn-id: svn://tug.org/texlive/trunk@50011 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/fontspec')
4 files changed, 240 insertions, 167 deletions
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty index 264240aec4c..987a42e5d85 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty @@ -41,7 +41,7 @@ \RequirePackage{xparse} \ProvidesExplPackage{fontspec-luatex}% - {2019/01/25}{2.7a}{Font selection for XeLaTeX and LuaLaTeX} + {2019/02/12}{2.7b}{Font selection for XeLaTeX and LuaLaTeX} %%^^A%% fontspec-code-load.dtx -- part of FONTSPEC <wspr.io/fontspec> %%^^A%% fontspec-code-vars.dtx -- part of FONTSPEC <wspr.io/fontspec> @@ -54,6 +54,7 @@ \bool_new:N \l__fontspec_atsui_bool \bool_new:N \l__fontspec_ot_bool \bool_new:N \l__fontspec_mm_bool +\bool_new:N \l__fontspec_harfbuzz_bool \bool_new:N \l__fontspec_graphite_bool \bool_new:N \l__fontspec_fontcfg_bool \bool_set_true:N \l__fontspec_fontcfg_bool @@ -71,7 +72,6 @@ \bool_new:N \l__fontspec_scriptlang_exist_bool \bool_new:N \g__fontspec_em_normalise_slant_bool \bool_new:N \l__fontspec_proceed_bool -\bool_new:N \l__fontspec_check_feat_bool \bool_new:N \l__fontspec_never_check_bool \int_new:N \l__fontspec_script_int \int_new:N \l__fontspec_language_int @@ -123,18 +123,17 @@ \prop_new:N \g__fontspec_family_int_prop \tl_new:N \l_fontspec_family_tl \tl_new:N \g_fontspec_encoding_tl -\tl_new:N \l_fontspec_renderer_tl \tl_new:N \l_fontspec_fontname_tl \tl_clear_new:N \UTFencname \tl_clear_new:N \cyrillicencoding \tl_clear_new:N \latinencoding -\tl_new:N \l_fontspec_mode_tl -\tl_new:N \g__fontspec_curr_series_tl +\tl_new:N \l__fontspec_renderer_tl +\tl_new:N \l__fontspec_mode_tl +\tl_new:N \l__fontspec_shaper_tl \tl_new:N \g__fontspec_defined_shapes_tl -\tl_new:N \g__fontspec_nfss_enc_tl -\tl_new:N \g__fontspec_nfss_family_tl \tl_new:N \g__fontspec_single_feat_tl \tl_new:N \l__fontspec_basename_tl +\tl_new:N \g__fontspec_curr_series_tl \tl_new:N \l__fontspec_curr_fontname_tl \tl_new:N \l__fontspec_curr_bfname_tl \tl_new:N \l__fontspec_ext_filename_tl @@ -142,29 +141,26 @@ \tl_new:N \l__fontspec_font_path_tl \tl_new:N \l__fontspec_fontid_tl \tl_new:N \l__fontspec_fontname_tl -\tl_new:N \l__fontspec_hexcol_tl +\tl_new:N \l__fontspec_options_tl +\tl_new:N \l__fontspec_saved_fontname_tl +\tl_new:N \g__fontspec_nfss_enc_tl +\tl_new:N \g__fontspec_nfss_family_tl \tl_new:N \l__fontspec_nfss_sc_tl \tl_new:N \l__fontspec_nfss_tl \tl_new:N \l__fontspec_nfss_fam_tl -\tl_new:N \l__fontspec_opacity_tl -\tl_new:N \l__fontspec_optical_size_tl -\tl_new:N \l__fontspec_options_tl -\tl_new:N \l__fontspec_saved_fontname_tl -\tl_new:N \l__fontspec_scale_tl \tl_new:N \l__fontspec_size_tl \tl_new:N \l__fontspec_sizedfont_tl \tl_new:N \l__fontspec_this_font_tl -\tl_new:N \l__fontspec_tmp_tl -\tl_new:N \l__fontspec_tmpa_tl -\tl_new:N \l__fontspec_tmpb_tl \tl_new:N \l__fontspec_ttc_index_tl +\tl_new:N \l__fontspec_smcp_shape_tl \tl_new:N \l__fontspec_emshape_query_tl \tl_new:N \l__fontspec_em_switch_tl +\tl_new:N \l__fontspec_strong_switch_tl +\tl_new:N \l__fontspec_tmp_tl +\tl_new:N \l__fontspec_tmpa_tl +\tl_new:N \l__fontspec_tmpb_tl \tl_new:N \l__fontspec_em_tmp_tl \tl_new:N \l__fontspec_strong_tmp_tl -\tl_new:N \l__fontspec_strong_switch_tl -\tl_new:N \l__fontspec_hyphenchar_tl -\tl_new:N \l__fontspec_smcp_shape_tl \tl_new:N \g__fontspec_mathrm_tl \tl_new:N \g__fontspec_bfmathrm_tl \tl_new:N \g__fontspec_mathsf_tl @@ -182,16 +178,21 @@ \tl_new:N \l__fontspec_fontname_sl_tl \tl_new:N \l__fontspec_fontname_bfsl_tl \tl_new:N \l__fontspec_fontname_sc_tl -\tl_new:N \l__fontspec_script_name_tl +\tl_new:N \l__fontspec_script_tl +\tl_new:N \l__fontspec_script_name_tl \tl_set:Nn \l__fontspec_script_name_tl {CustomDefault} -\tl_new:N \l_fontspec_script_tl -\tl_new:N \l__fontspec_lang_name_tl +\tl_new:N \l__fontspec_lang_tl +\tl_new:N \l__fontspec_lang_name_tl \tl_set:Nn \l__fontspec_lang_name_tl {Default} -\tl_new:N \l_fontspec_lang_tl -\tl_new:N \l__fontspec_mapping_tl -\tl_new:N \l__fontspec_punctspace_adjust_tl -\tl_new:N \l__fontspec_wordspace_adjust_tl -\tl_new:N \l__fontspec_postadjust_tl +\tl_new:N \l__fontspec_scale_tl +\tl_new:N \l__fontspec_hyphenchar_tl +\tl_new:N \l__fontspec_hexcol_tl +\tl_new:N \l__fontspec_opacity_tl +\tl_new:N \l__fontspec_optical_size_tl +\tl_new:N \l__fontspec_mapping_tl +\tl_new:N \l__fontspec_punctspace_adjust_tl +\tl_new:N \l__fontspec_wordspace_adjust_tl +\tl_new:N \l__fontspec_postadjust_tl \tl_const:Nn \c__fontspec_hexcol_tl {000000} \tl_const:Nn \c__fontspec_opacity_tl {FF~} \tl_const:Nn \c__fontspec_postadjust_tl { \l__fontspec_wordspace_adjust_tl \l__fontspec_punctspace_adjust_tl } @@ -346,19 +347,24 @@ } \__fontspec_msg_new:nnn {fontspec} {only-xetex-feature} { - Ignored XeTeX only feature: '#1'. + Ignored XeTeX-only feature: '#1'. } \__fontspec_msg_new:nnn {fontspec} {only-luatex-feature} { - Ignored LuaTeX only feature: '#1'. + Ignored LuaTeX-only feature: '#1'. + } +\__fontspec_msg_new:nnn {fontspec} {unknown-renderer} + { + Renderer '#1' unknown. Assuming Harfbuzz with 'shaper=#1'. + Please raise a fontspec issue to add this shaper to the interface. } \__fontspec_msg_new:nnn {fontspec} {no-mapping} { - Input mapping not (yet?) supported in LuaTeX. + Input mapping not supported in LuaTeX. } \__fontspec_msg_new:nnn {fontspec} {no-mapping-ligtex} { - Input mapping not (yet?) supported in LuaTeX.\\ + Input mapping not supported in LuaTeX.\\ Use "Ligatures=TeX" instead of "Mapping=tex-text". } \__fontspec_msg_new:nnn {fontspec} {cm-default-obsolete} @@ -626,19 +632,35 @@ } \NewDocumentCommand \newfontfamily { m O{} m O{} } { - \__fontspec_main_newfontfamily:nnnN {#1} {#2,#4} {#3} \NewDocumentCommand + \__fontspec_main_newfontfamily:NnnN #1 {#2,#4} {#3} \NewDocumentCommand } \NewDocumentCommand \renewfontfamily { m O{} m O{} } { - \__fontspec_main_newfontfamily:nnnN {#1} {#2,#4} {#3} \RenewDocumentCommand + \__fontspec_main_newfontfamily:NnnN #1 {#2,#4} {#3} \RenewDocumentCommand } \NewDocumentCommand \setfontfamily { m O{} m O{} } { - \__fontspec_main_newfontfamily:nnnN {#1} {#2,#4} {#3} \DeclareDocumentCommand + \__fontspec_main_newfontfamily:NnnN #1 {#2,#4} {#3} \DeclareDocumentCommand + } +\NewDocumentCommand \providefontfamily { m O{} m O{} } + { + \__fontspec_main_newfontfamily:NnnN #1 {#2,#4} {#3} \ProvideDocumentCommand } \NewDocumentCommand \newfontface { m O{} m O{} } { - \__fontspec_main_newfontface:nnn {#1} {#2,#4} {#3} + \__fontspec_main_newfontface:NnnN #1 {#2,#4} {#3} \NewDocumentCommand + } +\NewDocumentCommand \renewfontface { m O{} m O{} } + { + \__fontspec_main_newfontface:NnnN #1 {#2,#4} {#3} \RenewDocumentCommand + } +\NewDocumentCommand \setfontface { m O{} m O{} } + { + \__fontspec_main_newfontface:NnnN #1 {#2,#4} {#3} \DeclareDocumentCommand + } +\NewDocumentCommand \providefontface { m O{} m O{} } + { + \__fontspec_main_newfontface:NnnN #1 {#2,#4} {#3} \ProvideDocumentCommand } \NewDocumentCommand \defaultfontfeatures { t+ o m } { @@ -771,22 +793,22 @@ } \cs_new:Nn \__fontspec_main_setmathrm:nn { - \fontspec_set_family:Nnn \g__fontspec_mathrm_tl {Renderer=Basic,#1} {#2} + \fontspec_gset_family:Nnn \g__fontspec_mathrm_tl {Renderer=Basic,#1} {#2} \__fontspec_setmathrm_hook:nn {#1} {#2} } \cs_new:Nn \__fontspec_main_setboldmathrm:nn { - \fontspec_set_family:Nnn \g__fontspec_bfmathrm_tl {Renderer=Basic,#1} {#2} + \fontspec_gset_family:Nnn \g__fontspec_bfmathrm_tl {Renderer=Basic,#1} {#2} \__fontspec_setboldmathrm_hook:nn {#1} {#2} } \cs_new:Nn \__fontspec_main_setmathsf:nn { - \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {Renderer=Basic,#1} {#2} + \fontspec_gset_family:Nnn \g__fontspec_mathsf_tl {Renderer=Basic,#1} {#2} \__fontspec_setmathsf_hook:nn {#1} {#2} } \cs_new:Nn \__fontspec_main_setmathtt:nn { - \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {Renderer=Basic,#1} {#2} + \fontspec_gset_family:Nnn \g__fontspec_mathtt_tl {Renderer=Basic,#1} {#2} \__fontspec_setmathtt_hook:nn {#1} {#2} } \cs_set_eq:NN \__fontspec_setmainfont_hook:nn \use_none:nn @@ -803,7 +825,7 @@ \tl_gset:Nn \g__fontspec_mathrm_tl {\rmdefault} \tl_gset:Nn \g__fontspec_mathsf_tl {\sfdefault} \tl_gset:Nn \g__fontspec_mathtt_tl {\ttdefault} -\cs_new:Nn \__fontspec_main_newfontfamily:nnnN +\cs_new:Nn \__fontspec_main_newfontfamily:NnnN { \fontspec_set_family:cnn { l__fontspec_ \cs_to_str:N #1 _family_tl } {#2} {#3} \use:x @@ -816,9 +838,9 @@ } } } -\cs_new:Nn \__fontspec_main_newfontface:nnn +\cs_new:Nn \__fontspec_main_newfontface:NnnN { - \newfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2 ] {#3} + \__fontspec_main_newfontfamily:NnnN #1 { BoldFont={},ItalicFont={},SmallCapsFont={},#2 } {#3} #4 } \cs_new:Nn \__fontspec_set_default_features:nn { @@ -1040,8 +1062,8 @@ \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {lang-num} \l__fontspec_tmp_tl \int_set:Nn \l__fontspec_language_int {\l__fontspec_tmp_tl} - \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {script-tag} \l_fontspec_script_tl - \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {lang-tag} \l_fontspec_lang_tl + \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {script-tag} \l__fontspec_script_tl + \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {lang-tag} \l__fontspec_lang_tl \__fontspec_check_ot_feat:NnTF \font {#1} {\prg_return_true:} {\prg_return_false:} } @@ -1088,7 +1110,7 @@ { \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {script-num} \l__fontspec_tmp_tl \int_set:Nn \l__fontspec_script_int {\l__fontspec_tmp_tl} - \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {script-tag} \l_fontspec_script_tl + \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {script-tag} \l__fontspec_script_tl \__fontspec_check_lang:NnTF \font {#1} \prg_return_true: \prg_return_false: } @@ -1139,26 +1161,31 @@ } { \prg_return_false: } } -\cs_new:Nn \fontspec_set_family:Nnn +\cs_new:Nn \__fontspec_tl_new_if_free:N { \tl_if_exist:NF #1 { \tl_new:N #1 } } +\cs_new:Nn \__fontspec_set_family:NnnN { \tl_set:Nn \l__fontspec_fontface_cs_tl {\l_fontspec_font} % reset \tl_set:Nn \l__fontspec_family_label_tl {#1} \__fontspec_select_font_family:nn {#2} {#3} - \tl_if_exist:NF #1 { \tl_new:N #1 } - \tl_set_eq:NN #1 \l_fontspec_family_tl + \__fontspec_tl_new_if_free:N #1 + #4 #1 \l_fontspec_family_tl \tl_set:Nn \l__fontspec_fontface_cs_tl {\l_fontspec_font} % reset } +\cs_new:Nn \fontspec_gset_family:Nnn { \__fontspec_set_family:NnnN #1 {#2} {#3} \tl_gset_eq:NN } +\cs_new:Nn \fontspec_set_family:Nnn { \__fontspec_set_family:NnnN #1 {#2} {#3} \tl_set_eq:NN } \cs_generate_variant:Nn \fontspec_set_family:Nnn {c} \tl_new:N \l__fontspec_fontface_cs_tl \tl_set:Nn \l__fontspec_fontface_cs_tl {\l_fontspec_font} -\cs_new:Nn \fontspec_set_fontface:NNnn +\cs_new:Nn \__fontspec_set_fontface:NNnnN { \tl_set:Nn \l__fontspec_fontface_cs_tl {#1} \tl_set:Nn \l__fontspec_family_label_tl {#2} \__fontspec_select_font_family:nn {#3} {#4} - \tl_set_eq:NN #2 \l_fontspec_family_tl + #5 #2 \l_fontspec_family_tl \tl_set:Nn \l__fontspec_fontface_cs_tl {\l_fontspec_font} % reset } +\cs_new:Nn \fontspec_gset_fontface:NNnn { \__fontspec_set_fontface:NNnnN #1 #2 {#3} {#4} \tl_gset_eq:NN } +\cs_new:Nn \fontspec_set_fontface:NNnn { \__fontspec_set_fontface:NNnnN #1 #2 {#3} {#4} \tl_set_eq:NN } \prg_new_conditional:Nnn \fontspec_font_if_exist:n {TF,T,F} { \group_begin: @@ -1350,7 +1377,7 @@ {#1} \l__fontspec_extension_tl \l__fontspec_ttc_index_tl - \l_fontspec_renderer_tl + \l__fontspec_renderer_tl \l__fontspec_optical_size_tl {#2} } @@ -1445,8 +1472,8 @@ } \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {script-num} \l__fontspec_script_int \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {lang-num} \l__fontspec_language_int - \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {script-tag} \l_fontspec_script_tl - \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {lang-tag} \l_fontspec_lang_tl + \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {script-tag} \l__fontspec_script_tl + \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {lang-tag} \l__fontspec_lang_tl } \cs_new:Nn \__fontspec_find_autofonts: { @@ -1701,11 +1728,15 @@ } \tl_set:Nn \l__fontspec_pre_feat_sclist { - mode = \l_fontspec_mode_tl ; - \tl_if_empty:NF \l_fontspec_script_tl + mode = \l__fontspec_mode_tl ; + \tl_if_empty:NF \l__fontspec_shaper_tl + { + shaper = \l__fontspec_shaper_tl ; + } + \tl_if_empty:NF \l__fontspec_script_tl { - script = \l_fontspec_script_tl ; - language = \l_fontspec_lang_tl ; + script = \l__fontspec_script_tl ; + language = \l__fontspec_lang_tl ; } } \cs_new:Nn \__fontspec_make_smallcaps:TF @@ -1727,6 +1758,7 @@ \tl_gremove_all:Nn \g__fontspec_rawfeatures_sclist {##1;} } } +\cs_generate_variant:Nn \__fontspec_remove_clashing_featstr:n {x} \cs_set:Npn \__fontspec_init: { \bool_set_false:N \l__fontspec_ot_bool @@ -1735,11 +1767,11 @@ \tl_clear:N \l__fontspec_font_path_tl \tl_clear:N \l__fontspec_optical_size_tl \tl_clear:N \l__fontspec_ttc_index_tl - \tl_clear:N \l_fontspec_renderer_tl + \tl_clear:N \l__fontspec_renderer_tl \tl_gclear:N \g__fontspec_defined_shapes_tl \tl_gclear:N \g__fontspec_curr_series_tl \tl_gset_eq:NN \g__fontspec_nfss_enc_tl \g_fontspec_encoding_tl - \tl_set:Nn \l_fontspec_mode_tl {node} + \tl_set:Nn \l__fontspec_mode_tl {node} \int_set:Nn \prehyphenchar { `\- } % fixme \int_zero:N \posthyphenchar % fixme \int_zero:N \preexhyphenchar % fixme @@ -1828,10 +1860,8 @@ { \bool_set_true:N \l__fontspec_proceed_bool - \bool_set_true:N \l__fontspec_check_feat_bool - \tl_if_empty:nT {#1} { \bool_set_false:N \l__fontspec_check_feat_bool } - \bool_if:NT \l__fontspec_check_feat_bool + \tl_if_empty:nF {#1} { \exp_args:No \__fontspec_check_ot_feat:NnF \l__fontspec_fontface_cs_tl {#1} { @@ -1840,13 +1870,9 @@ } } - \bool_if:NT \l__fontspec_proceed_bool - { - \exp_args:Nx \__fontspec_remove_clashing_featstr:n - { #2 , \__fontspec_swap_plus_minus:n {#2} , #3 } + \__fontspec_remove_clashing_featstr:x { #2 , \__fontspec_swap_plus_minus:n {#2} , #3 } - \__fontspec_update_featstr:n {#2} - } + \bool_if:NT \l__fontspec_proceed_bool { \__fontspec_update_featstr:n {#2} } } \cs_generate_variant:Nn \__fontspec_make_OT_feature:nnn {xxx} \cs_new:Nn \__fontspec_swap_plus_minus:n { \__fontspec_swap_plus_minus_aux:Nq #1 \q_nil } @@ -1877,7 +1903,7 @@ } \prg_new_conditional:Nnn \__fontspec_check_lang:Nn {TF} { - \__fontspec_check_lang:NnnTF #1 {#2} {\l_fontspec_script_tl} {\prg_return_true:} {\prg_return_false:} + \__fontspec_check_lang:NnnTF #1 {#2} {\l__fontspec_script_tl} {\prg_return_true:} {\prg_return_false:} } \prg_new_conditional:Nnn \__fontspec_check_lang:Nnn {TF} { @@ -1899,7 +1925,7 @@ } \prg_new_conditional:Nnn \__fontspec_check_ot_feat:Nn {TF,F} { - \__fontspec_check_ot_feat:NnnnTF #1 {#2} {\l_fontspec_lang_tl} {\l_fontspec_script_tl} + \__fontspec_check_ot_feat:NnnnTF #1 {#2} {\l__fontspec_lang_tl} {\l__fontspec_script_tl} {\prg_return_true:} {\prg_return_false:} } \prg_new_conditional:Nnn \__fontspec_check_ot_feat:Nnnn {TF,F} @@ -2095,20 +2121,35 @@ \keys_define:nn {fontspec-renderer} { Renderer .choices:nn = - {AAT,ICU,OpenType,Graphite,Full,Basic} + {Full,Node,Basic,Base,Harfbuzz,OpenType,AAT,Graphite} { - \int_compare:nTF {\l_keys_choice_int <= 4} + \int_compare:nTF {\l_keys_choice_int >= 5} { \bool_set_true:N \l__fontspec_harfbuzz_bool } + + \tl_set:Nx \l__fontspec_mode_tl { - \__fontspec_warning:nx {only-xetex-feature} {Renderer=AAT/OpenType/Graphite} + \int_case:nn \l_keys_choice_int { 1 {node} 2 {node} 3 {base} 4 {base} 5 {harf} 6 {harf} 7 {harf} 8 {harf} } } + + \tl_set:Nx \l__fontspec_shaper_tl { - \tl_set:Nx \l_fontspec_mode_tl - { - \int_case:nn \l_keys_choice_int { 5 {node} 6 {base} } - } - \tl_gset:Nx \g__fontspec_single_feat_tl { mode=\l_fontspec_mode_tl } + \int_case:nn \l_keys_choice_int { 1 {} 2 {} 3 {} 4 {} 5 {} 6 {ot} 7 {coretext_aat} 8 {graphite2} } } - } + + + \tl_gset:Nx \g__fontspec_single_feat_tl + { + mode=\l__fontspec_mode_tl ; + \tl_if_empty:NF \l__fontspec_shaper_tl { shaper=\l__fontspec_shaper_tl} + } + } , + + Renderer unknown .code:n = + { + \bool_set_true:N \l__fontspec_harfbuzz_bool + \__fontspec_warning:nx {unknown-renderer} {#1} + \tl_set:Nn \l__fontspec_mode_tl {harf} + \tl_set:Nn \l__fontspec_shaper_tl {#1} + } , } \__fontspec_keys_define_code:nnn {fontspec-preparse} {Script} { @@ -2834,7 +2875,7 @@ \exp_args:No \__fontspec_check_script:NnT \l__fontspec_fontface_cs_tl {####1} { \tl_set:Nn \l__fontspec_script_name_tl {#1} - \tl_set:Nn \l_fontspec_script_tl {####1} + \tl_set:Nn \l__fontspec_script_tl {####1} \int_set:Nn \l__fontspec_script_int {\l__fontspec_strnum_int} \bool_set_true:N \l__fontspec_scriptlang_exist_bool \tl_gset:Nx \g__fontspec_single_feat_tl { script=####1 } @@ -2875,11 +2916,11 @@ \bool_set_false:N \l__fontspec_scriptlang_exist_bool \clist_map_inline:nn {#2} { - \exp_args:No \__fontspec_check_lang:NnTF \l__fontspec_fontface_cs_tl {#2} + \exp_args:No \__fontspec_check_lang:NnTF \l__fontspec_fontface_cs_tl {####1} { - \tl_set:Nn \l_fontspec_lang_tl {#2} + \tl_set:Nn \l__fontspec_lang_tl {####1} \int_set:Nn \l__fontspec_language_int {\l__fontspec_strnum_int} - \tl_gset:Nx \g__fontspec_single_feat_tl { language=#2 } + \tl_gset:Nx \g__fontspec_single_feat_tl { language=####1 } \bool_set_true:N \l__fontspec_scriptlang_exist_bool \clist_map_break: } @@ -2894,7 +2935,7 @@ } \__fontspec_keys_define_code:nnn {fontspec-opentype} { Language / Default } { - \tl_set:Nn \l_fontspec_lang_tl {DFLT} + \tl_set:Nn \l__fontspec_lang_tl {DFLT} \int_zero:N \l__fontspec_language_int \tl_gset:Nn \g__fontspec_single_feat_tl { language=DFLT } } @@ -3673,6 +3714,11 @@ \@ifpackageloaded{MinionPro} {\bool_gset_false:N \g__fontspec_math_bool}{} \@ifpackageloaded{unicode-math} {\bool_gset_false:N \g__fontspec_math_bool}{} \@ifpackageloaded{breqn} {\bool_gset_false:N \g__fontspec_math_bool}{} + \@ifpackageloaded{pxfonts} {\bool_gset_false:N \g__fontspec_math_bool}{} + \@ifpackageloaded{txfonts} {\bool_gset_false:N \g__fontspec_math_bool}{} + \@ifpackageloaded{newpxmath} {\bool_gset_false:N \g__fontspec_math_bool}{} + \@ifpackageloaded{newtxmath} {\bool_gset_false:N \g__fontspec_math_bool}{} + \@ifpackageloaded{mtpro2} {\bool_gset_false:N \g__fontspec_math_bool}{} \bool_if:NT \g__fontspec_math_bool { \__fontspec_info:n {setup-math} diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty index 02f23259be2..ba9bcca405c 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty @@ -41,7 +41,7 @@ \RequirePackage{xparse} \ProvidesExplPackage{fontspec-xetex}% - {2019/01/25}{2.7a}{Font selection for XeLaTeX and LuaLaTeX} + {2019/02/12}{2.7b}{Font selection for XeLaTeX and LuaLaTeX} %%^^A%% fontspec-code-load.dtx -- part of FONTSPEC <wspr.io/fontspec> %%^^A%% fontspec-code-vars.dtx -- part of FONTSPEC <wspr.io/fontspec> @@ -54,6 +54,7 @@ \bool_new:N \l__fontspec_atsui_bool \bool_new:N \l__fontspec_ot_bool \bool_new:N \l__fontspec_mm_bool +\bool_new:N \l__fontspec_harfbuzz_bool \bool_new:N \l__fontspec_graphite_bool \bool_new:N \l__fontspec_fontcfg_bool \bool_set_true:N \l__fontspec_fontcfg_bool @@ -71,7 +72,6 @@ \bool_new:N \l__fontspec_scriptlang_exist_bool \bool_new:N \g__fontspec_em_normalise_slant_bool \bool_new:N \l__fontspec_proceed_bool -\bool_new:N \l__fontspec_check_feat_bool \bool_new:N \l__fontspec_never_check_bool \int_new:N \l__fontspec_script_int \int_new:N \l__fontspec_language_int @@ -123,18 +123,17 @@ \prop_new:N \g__fontspec_family_int_prop \tl_new:N \l_fontspec_family_tl \tl_new:N \g_fontspec_encoding_tl -\tl_new:N \l_fontspec_renderer_tl \tl_new:N \l_fontspec_fontname_tl \tl_clear_new:N \UTFencname \tl_clear_new:N \cyrillicencoding \tl_clear_new:N \latinencoding -\tl_new:N \l_fontspec_mode_tl -\tl_new:N \g__fontspec_curr_series_tl +\tl_new:N \l__fontspec_renderer_tl +\tl_new:N \l__fontspec_mode_tl +\tl_new:N \l__fontspec_shaper_tl \tl_new:N \g__fontspec_defined_shapes_tl -\tl_new:N \g__fontspec_nfss_enc_tl -\tl_new:N \g__fontspec_nfss_family_tl \tl_new:N \g__fontspec_single_feat_tl \tl_new:N \l__fontspec_basename_tl +\tl_new:N \g__fontspec_curr_series_tl \tl_new:N \l__fontspec_curr_fontname_tl \tl_new:N \l__fontspec_curr_bfname_tl \tl_new:N \l__fontspec_ext_filename_tl @@ -142,29 +141,26 @@ \tl_new:N \l__fontspec_font_path_tl \tl_new:N \l__fontspec_fontid_tl \tl_new:N \l__fontspec_fontname_tl -\tl_new:N \l__fontspec_hexcol_tl +\tl_new:N \l__fontspec_options_tl +\tl_new:N \l__fontspec_saved_fontname_tl +\tl_new:N \g__fontspec_nfss_enc_tl +\tl_new:N \g__fontspec_nfss_family_tl \tl_new:N \l__fontspec_nfss_sc_tl \tl_new:N \l__fontspec_nfss_tl \tl_new:N \l__fontspec_nfss_fam_tl -\tl_new:N \l__fontspec_opacity_tl -\tl_new:N \l__fontspec_optical_size_tl -\tl_new:N \l__fontspec_options_tl -\tl_new:N \l__fontspec_saved_fontname_tl -\tl_new:N \l__fontspec_scale_tl \tl_new:N \l__fontspec_size_tl \tl_new:N \l__fontspec_sizedfont_tl \tl_new:N \l__fontspec_this_font_tl -\tl_new:N \l__fontspec_tmp_tl -\tl_new:N \l__fontspec_tmpa_tl -\tl_new:N \l__fontspec_tmpb_tl \tl_new:N \l__fontspec_ttc_index_tl +\tl_new:N \l__fontspec_smcp_shape_tl \tl_new:N \l__fontspec_emshape_query_tl \tl_new:N \l__fontspec_em_switch_tl +\tl_new:N \l__fontspec_strong_switch_tl +\tl_new:N \l__fontspec_tmp_tl +\tl_new:N \l__fontspec_tmpa_tl +\tl_new:N \l__fontspec_tmpb_tl \tl_new:N \l__fontspec_em_tmp_tl \tl_new:N \l__fontspec_strong_tmp_tl -\tl_new:N \l__fontspec_strong_switch_tl -\tl_new:N \l__fontspec_hyphenchar_tl -\tl_new:N \l__fontspec_smcp_shape_tl \tl_new:N \g__fontspec_mathrm_tl \tl_new:N \g__fontspec_bfmathrm_tl \tl_new:N \g__fontspec_mathsf_tl @@ -182,16 +178,21 @@ \tl_new:N \l__fontspec_fontname_sl_tl \tl_new:N \l__fontspec_fontname_bfsl_tl \tl_new:N \l__fontspec_fontname_sc_tl -\tl_new:N \l__fontspec_script_name_tl +\tl_new:N \l__fontspec_script_tl +\tl_new:N \l__fontspec_script_name_tl \tl_set:Nn \l__fontspec_script_name_tl {CustomDefault} -\tl_new:N \l_fontspec_script_tl -\tl_new:N \l__fontspec_lang_name_tl +\tl_new:N \l__fontspec_lang_tl +\tl_new:N \l__fontspec_lang_name_tl \tl_set:Nn \l__fontspec_lang_name_tl {Default} -\tl_new:N \l_fontspec_lang_tl -\tl_new:N \l__fontspec_mapping_tl -\tl_new:N \l__fontspec_punctspace_adjust_tl -\tl_new:N \l__fontspec_wordspace_adjust_tl -\tl_new:N \l__fontspec_postadjust_tl +\tl_new:N \l__fontspec_scale_tl +\tl_new:N \l__fontspec_hyphenchar_tl +\tl_new:N \l__fontspec_hexcol_tl +\tl_new:N \l__fontspec_opacity_tl +\tl_new:N \l__fontspec_optical_size_tl +\tl_new:N \l__fontspec_mapping_tl +\tl_new:N \l__fontspec_punctspace_adjust_tl +\tl_new:N \l__fontspec_wordspace_adjust_tl +\tl_new:N \l__fontspec_postadjust_tl \tl_const:Nn \c__fontspec_hexcol_tl {000000} \tl_const:Nn \c__fontspec_opacity_tl {FF~} \tl_const:Nn \c__fontspec_postadjust_tl { \l__fontspec_wordspace_adjust_tl \l__fontspec_punctspace_adjust_tl } @@ -346,19 +347,24 @@ } \__fontspec_msg_new:nnn {fontspec} {only-xetex-feature} { - Ignored XeTeX only feature: '#1'. + Ignored XeTeX-only feature: '#1'. } \__fontspec_msg_new:nnn {fontspec} {only-luatex-feature} { - Ignored LuaTeX only feature: '#1'. + Ignored LuaTeX-only feature: '#1'. + } +\__fontspec_msg_new:nnn {fontspec} {unknown-renderer} + { + Renderer '#1' unknown. Assuming Harfbuzz with 'shaper=#1'. + Please raise a fontspec issue to add this shaper to the interface. } \__fontspec_msg_new:nnn {fontspec} {no-mapping} { - Input mapping not (yet?) supported in LuaTeX. + Input mapping not supported in LuaTeX. } \__fontspec_msg_new:nnn {fontspec} {no-mapping-ligtex} { - Input mapping not (yet?) supported in LuaTeX.\\ + Input mapping not supported in LuaTeX.\\ Use "Ligatures=TeX" instead of "Mapping=tex-text". } \__fontspec_msg_new:nnn {fontspec} {cm-default-obsolete} @@ -619,19 +625,35 @@ } \NewDocumentCommand \newfontfamily { m O{} m O{} } { - \__fontspec_main_newfontfamily:nnnN {#1} {#2,#4} {#3} \NewDocumentCommand + \__fontspec_main_newfontfamily:NnnN #1 {#2,#4} {#3} \NewDocumentCommand } \NewDocumentCommand \renewfontfamily { m O{} m O{} } { - \__fontspec_main_newfontfamily:nnnN {#1} {#2,#4} {#3} \RenewDocumentCommand + \__fontspec_main_newfontfamily:NnnN #1 {#2,#4} {#3} \RenewDocumentCommand } \NewDocumentCommand \setfontfamily { m O{} m O{} } { - \__fontspec_main_newfontfamily:nnnN {#1} {#2,#4} {#3} \DeclareDocumentCommand + \__fontspec_main_newfontfamily:NnnN #1 {#2,#4} {#3} \DeclareDocumentCommand + } +\NewDocumentCommand \providefontfamily { m O{} m O{} } + { + \__fontspec_main_newfontfamily:NnnN #1 {#2,#4} {#3} \ProvideDocumentCommand } \NewDocumentCommand \newfontface { m O{} m O{} } { - \__fontspec_main_newfontface:nnn {#1} {#2,#4} {#3} + \__fontspec_main_newfontface:NnnN #1 {#2,#4} {#3} \NewDocumentCommand + } +\NewDocumentCommand \renewfontface { m O{} m O{} } + { + \__fontspec_main_newfontface:NnnN #1 {#2,#4} {#3} \RenewDocumentCommand + } +\NewDocumentCommand \setfontface { m O{} m O{} } + { + \__fontspec_main_newfontface:NnnN #1 {#2,#4} {#3} \DeclareDocumentCommand + } +\NewDocumentCommand \providefontface { m O{} m O{} } + { + \__fontspec_main_newfontface:NnnN #1 {#2,#4} {#3} \ProvideDocumentCommand } \NewDocumentCommand \defaultfontfeatures { t+ o m } { @@ -764,22 +786,22 @@ } \cs_new:Nn \__fontspec_main_setmathrm:nn { - \fontspec_set_family:Nnn \g__fontspec_mathrm_tl {#1} {#2} + \fontspec_gset_family:Nnn \g__fontspec_mathrm_tl {#1} {#2} \__fontspec_setmathrm_hook:nn {#1} {#2} } \cs_new:Nn \__fontspec_main_setboldmathrm:nn { - \fontspec_set_family:Nnn \g__fontspec_bfmathrm_tl {#1} {#2} + \fontspec_gset_family:Nnn \g__fontspec_bfmathrm_tl {#1} {#2} \__fontspec_setboldmathrm_hook:nn {#1} {#2} } \cs_new:Nn \__fontspec_main_setmathsf:nn { - \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {#1} {#2} + \fontspec_gset_family:Nnn \g__fontspec_mathsf_tl {#1} {#2} \__fontspec_setmathsf_hook:nn {#1} {#2} } \cs_new:Nn \__fontspec_main_setmathtt:nn { - \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {#1} {#2} + \fontspec_gset_family:Nnn \g__fontspec_mathtt_tl {#1} {#2} \__fontspec_setmathtt_hook:nn {#1} {#2} } \cs_set_eq:NN \__fontspec_setmainfont_hook:nn \use_none:nn @@ -796,7 +818,7 @@ \tl_gset:Nn \g__fontspec_mathrm_tl {\rmdefault} \tl_gset:Nn \g__fontspec_mathsf_tl {\sfdefault} \tl_gset:Nn \g__fontspec_mathtt_tl {\ttdefault} -\cs_new:Nn \__fontspec_main_newfontfamily:nnnN +\cs_new:Nn \__fontspec_main_newfontfamily:NnnN { \fontspec_set_family:cnn { l__fontspec_ \cs_to_str:N #1 _family_tl } {#2} {#3} \use:x @@ -809,9 +831,9 @@ } } } -\cs_new:Nn \__fontspec_main_newfontface:nnn +\cs_new:Nn \__fontspec_main_newfontface:NnnN { - \newfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2 ] {#3} + \__fontspec_main_newfontfamily:NnnN #1 { BoldFont={},ItalicFont={},SmallCapsFont={},#2 } {#3} #4 } \cs_new:Nn \__fontspec_set_default_features:nn { @@ -1033,8 +1055,8 @@ \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {lang-num} \l__fontspec_tmp_tl \int_set:Nn \l__fontspec_language_int {\l__fontspec_tmp_tl} - \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {script-tag} \l_fontspec_script_tl - \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {lang-tag} \l_fontspec_lang_tl + \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {script-tag} \l__fontspec_script_tl + \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {lang-tag} \l__fontspec_lang_tl \__fontspec_check_ot_feat:NnTF \font {#1} {\prg_return_true:} {\prg_return_false:} } @@ -1081,7 +1103,7 @@ { \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {script-num} \l__fontspec_tmp_tl \int_set:Nn \l__fontspec_script_int {\l__fontspec_tmp_tl} - \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {script-tag} \l_fontspec_script_tl + \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {script-tag} \l__fontspec_script_tl \__fontspec_check_lang:NnTF \font {#1} \prg_return_true: \prg_return_false: } @@ -1132,26 +1154,31 @@ } { \prg_return_false: } } -\cs_new:Nn \fontspec_set_family:Nnn +\cs_new:Nn \__fontspec_tl_new_if_free:N { \tl_if_exist:NF #1 { \tl_new:N #1 } } +\cs_new:Nn \__fontspec_set_family:NnnN { \tl_set:Nn \l__fontspec_fontface_cs_tl {\l_fontspec_font} % reset \tl_set:Nn \l__fontspec_family_label_tl {#1} \__fontspec_select_font_family:nn {#2} {#3} - \tl_if_exist:NF #1 { \tl_new:N #1 } - \tl_set_eq:NN #1 \l_fontspec_family_tl + \__fontspec_tl_new_if_free:N #1 + #4 #1 \l_fontspec_family_tl \tl_set:Nn \l__fontspec_fontface_cs_tl {\l_fontspec_font} % reset } +\cs_new:Nn \fontspec_gset_family:Nnn { \__fontspec_set_family:NnnN #1 {#2} {#3} \tl_gset_eq:NN } +\cs_new:Nn \fontspec_set_family:Nnn { \__fontspec_set_family:NnnN #1 {#2} {#3} \tl_set_eq:NN } \cs_generate_variant:Nn \fontspec_set_family:Nnn {c} \tl_new:N \l__fontspec_fontface_cs_tl \tl_set:Nn \l__fontspec_fontface_cs_tl {\l_fontspec_font} -\cs_new:Nn \fontspec_set_fontface:NNnn +\cs_new:Nn \__fontspec_set_fontface:NNnnN { \tl_set:Nn \l__fontspec_fontface_cs_tl {#1} \tl_set:Nn \l__fontspec_family_label_tl {#2} \__fontspec_select_font_family:nn {#3} {#4} - \tl_set_eq:NN #2 \l_fontspec_family_tl + #5 #2 \l_fontspec_family_tl \tl_set:Nn \l__fontspec_fontface_cs_tl {\l_fontspec_font} % reset } +\cs_new:Nn \fontspec_gset_fontface:NNnn { \__fontspec_set_fontface:NNnnN #1 #2 {#3} {#4} \tl_gset_eq:NN } +\cs_new:Nn \fontspec_set_fontface:NNnn { \__fontspec_set_fontface:NNnnN #1 #2 {#3} {#4} \tl_set_eq:NN } \prg_new_conditional:Nnn \fontspec_font_if_exist:n {TF,T,F} { \group_begin: @@ -1342,7 +1369,7 @@ {#1} \l__fontspec_extension_tl \l__fontspec_ttc_index_tl - \l_fontspec_renderer_tl + \l__fontspec_renderer_tl \l__fontspec_optical_size_tl {#2} } @@ -1444,8 +1471,8 @@ } \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {script-num} \l__fontspec_script_int \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {lang-num} \l__fontspec_language_int - \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {script-tag} \l_fontspec_script_tl - \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {lang-tag} \l_fontspec_lang_tl + \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {script-tag} \l__fontspec_script_tl + \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {lang-tag} \l__fontspec_lang_tl } \cs_new:Nn \__fontspec_find_autofonts: { @@ -1514,16 +1541,16 @@ \bool_set_true:N \l__fontspec_tfm_bool \or \bool_set_true:N \l__fontspec_atsui_bool -\tl_if_empty:NT \l_fontspec_renderer_tl { \tl_set:Nn \l_fontspec_renderer_tl {/AAT} } +\tl_if_empty:NT \l__fontspec_renderer_tl { \tl_set:Nn \l__fontspec_renderer_tl {/AAT} } \ifnum\XeTeXcountvariations #1 > 0\relax \bool_set_true:N \l__fontspec_mm_bool \fi \or \bool_set_true:N \l__fontspec_ot_bool -\tl_if_empty:NT \l_fontspec_renderer_tl { \tl_set:Nn \l_fontspec_renderer_tl {/OT} } +\tl_if_empty:NT \l__fontspec_renderer_tl { \tl_set:Nn \l__fontspec_renderer_tl {/OT} } \or \bool_set_true:N \l__fontspec_graphite_bool -\tl_if_empty:NT \l_fontspec_renderer_tl { \tl_set:Nn \l_fontspec_renderer_tl {/GR} } +\tl_if_empty:NT \l__fontspec_renderer_tl { \tl_set:Nn \l__fontspec_renderer_tl {/GR} } \fi } \cs_new:Nn \__fontspec_set_autofont:Nnn @@ -1720,10 +1747,10 @@ { \bool_if:NT \l__fontspec_ot_bool { - \tl_if_empty:NF \l_fontspec_script_tl + \tl_if_empty:NF \l__fontspec_script_tl { - script = \l_fontspec_script_tl ; - language = \l_fontspec_lang_tl ; + script = \l__fontspec_script_tl ; + language = \l__fontspec_lang_tl ; } } } @@ -1758,6 +1785,7 @@ \tl_gremove_all:Nn \g__fontspec_rawfeatures_sclist {##1;} } } +\cs_generate_variant:Nn \__fontspec_remove_clashing_featstr:n {x} \cs_set:Npn \__fontspec_init: { \bool_set_false:N \l__fontspec_ot_bool @@ -1766,7 +1794,7 @@ \tl_clear:N \l__fontspec_font_path_tl \tl_clear:N \l__fontspec_optical_size_tl \tl_clear:N \l__fontspec_ttc_index_tl - \tl_clear:N \l_fontspec_renderer_tl + \tl_clear:N \l__fontspec_renderer_tl \tl_gclear:N \g__fontspec_defined_shapes_tl \tl_gclear:N \g__fontspec_curr_series_tl \tl_gset_eq:NN \g__fontspec_nfss_enc_tl \g_fontspec_encoding_tl @@ -1869,10 +1897,8 @@ { \bool_set_true:N \l__fontspec_proceed_bool - \bool_set_true:N \l__fontspec_check_feat_bool - \tl_if_empty:nT {#1} { \bool_set_false:N \l__fontspec_check_feat_bool } - \bool_if:NT \l__fontspec_check_feat_bool + \tl_if_empty:nF {#1} { \exp_args:No \__fontspec_check_ot_feat:NnF \l__fontspec_fontface_cs_tl {#1} { @@ -1881,13 +1907,9 @@ } } - \bool_if:NT \l__fontspec_proceed_bool - { - \exp_args:Nx \__fontspec_remove_clashing_featstr:n - { #2 , \__fontspec_swap_plus_minus:n {#2} , #3 } + \__fontspec_remove_clashing_featstr:x { #2 , \__fontspec_swap_plus_minus:n {#2} , #3 } - \__fontspec_update_featstr:n {#2} - } + \bool_if:NT \l__fontspec_proceed_bool { \__fontspec_update_featstr:n {#2} } } \cs_generate_variant:Nn \__fontspec_make_OT_feature:nnn {xxx} \cs_new:Nn \__fontspec_swap_plus_minus:n { \__fontspec_swap_plus_minus_aux:Nq #1 \q_nil } @@ -1920,7 +1942,7 @@ } \prg_new_conditional:Nnn \__fontspec_check_lang:Nn {TF} { - \__fontspec_check_lang:NnnTF #1 {#2} {\l_fontspec_script_tl} {\prg_return_true:} {\prg_return_false:} + \__fontspec_check_lang:NnnTF #1 {#2} {\l__fontspec_script_tl} {\prg_return_true:} {\prg_return_false:} } \prg_new_conditional:Nnn \__fontspec_check_lang:Nnn {TF} { @@ -1956,7 +1978,7 @@ } \prg_new_conditional:Nnn \__fontspec_check_ot_feat:Nn {TF,F} { - \__fontspec_check_ot_feat:NnnnTF #1 {#2} {\l_fontspec_lang_tl} {\l_fontspec_script_tl} + \__fontspec_check_ot_feat:NnnnTF #1 {#2} {\l__fontspec_lang_tl} {\l__fontspec_script_tl} {\prg_return_true:} {\prg_return_false:} } \prg_new_conditional:Nnn \__fontspec_check_ot_feat:Nnnn {TF,F} @@ -2227,18 +2249,18 @@ \keys_define:nn {fontspec-renderer} { Renderer .choices:nn = - {AAT,ICU,OpenType,Graphite,Full,Basic} + {AAT,ICU,OpenType,Graphite,Full,Basic,Node,Base,Harfbuzz} { \int_compare:nTF {\l_keys_choice_int <= 4} { - \tl_set:Nx \l_fontspec_renderer_tl + \tl_set:Nx \l__fontspec_renderer_tl { \int_case:nn \l_keys_choice_int { 1 {/AAT} 2 {/OT} 3 {/OT} 4 {/GR} } } - \tl_gset:Nx \g__fontspec_single_feat_tl { \l_fontspec_renderer_tl } + \tl_gset:Nx \g__fontspec_single_feat_tl { \l__fontspec_renderer_tl } } { - \__fontspec_warning:nx {only-luatex-feature} {Renderer=Full/Basic} + \__fontspec_warning:nx {only-luatex-feature} {Renderer=Full/Basic/Node/Base/Harfbuzz} } } } @@ -2984,7 +3006,7 @@ \exp_args:No \__fontspec_check_script:NnT \l__fontspec_fontface_cs_tl {####1} { \tl_set:Nn \l__fontspec_script_name_tl {#1} - \tl_set:Nn \l_fontspec_script_tl {####1} + \tl_set:Nn \l__fontspec_script_tl {####1} \int_set:Nn \l__fontspec_script_int {\l__fontspec_strnum_int} \bool_set_true:N \l__fontspec_scriptlang_exist_bool \tl_gset:Nx \g__fontspec_single_feat_tl { script=####1 } @@ -3025,11 +3047,11 @@ \bool_set_false:N \l__fontspec_scriptlang_exist_bool \clist_map_inline:nn {#2} { - \exp_args:No \__fontspec_check_lang:NnTF \l__fontspec_fontface_cs_tl {#2} + \exp_args:No \__fontspec_check_lang:NnTF \l__fontspec_fontface_cs_tl {####1} { - \tl_set:Nn \l_fontspec_lang_tl {#2} + \tl_set:Nn \l__fontspec_lang_tl {####1} \int_set:Nn \l__fontspec_language_int {\l__fontspec_strnum_int} - \tl_gset:Nx \g__fontspec_single_feat_tl { language=#2 } + \tl_gset:Nx \g__fontspec_single_feat_tl { language=####1 } \bool_set_true:N \l__fontspec_scriptlang_exist_bool \clist_map_break: } @@ -3044,7 +3066,7 @@ } \__fontspec_keys_define_code:nnn {fontspec-opentype} { Language / Default } { - \tl_set:Nn \l_fontspec_lang_tl {DFLT} + \tl_set:Nn \l__fontspec_lang_tl {DFLT} \int_zero:N \l__fontspec_language_int \tl_gset:Nn \g__fontspec_single_feat_tl { language=DFLT } } @@ -3960,6 +3982,11 @@ \@ifpackageloaded{MinionPro} {\bool_gset_false:N \g__fontspec_math_bool}{} \@ifpackageloaded{unicode-math} {\bool_gset_false:N \g__fontspec_math_bool}{} \@ifpackageloaded{breqn} {\bool_gset_false:N \g__fontspec_math_bool}{} + \@ifpackageloaded{pxfonts} {\bool_gset_false:N \g__fontspec_math_bool}{} + \@ifpackageloaded{txfonts} {\bool_gset_false:N \g__fontspec_math_bool}{} + \@ifpackageloaded{newpxmath} {\bool_gset_false:N \g__fontspec_math_bool}{} + \@ifpackageloaded{newtxmath} {\bool_gset_false:N \g__fontspec_math_bool}{} + \@ifpackageloaded{mtpro2} {\bool_gset_false:N \g__fontspec_math_bool}{} \bool_if:NT \g__fontspec_math_bool { \__fontspec_info:n {setup-math} diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua index 5cc60a81597..81ba4d6cc29 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua @@ -23,8 +23,8 @@ fontspec = fontspec or {} local fontspec = fontspec fontspec.module = { name = "fontspec", - version = "2.7a", - date = "2019/01/25", + version = "2.7b", + date = "2019/02/12", description = "Font selection for XeLaTeX and LuaLaTeX", author = "Khaled Hosny, Philipp Gesang, Will Robertson", copyright = "Khaled Hosny, Philipp Gesang, Will Robertson", diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty index e46c9205de6..0d60008ae5f 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty @@ -21,7 +21,7 @@ \RequirePackage{xparse} \ProvidesExplPackage{fontspec}% - {2019/01/25}{2.7a}{Font selection for XeLaTeX and LuaLaTeX} + {2019/02/12}{2.7b}{Font selection for XeLaTeX and LuaLaTeX} %%^^A%% fontspec-code-load.dtx -- part of FONTSPEC <wspr.io/fontspec> \sys_if_engine_luatex:T |