diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty | 71 |
1 files changed, 49 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty index 89a2168a0b8..ddc64587645 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty @@ -32,7 +32,7 @@ \RequirePackage{expl3} \RequirePackage{xparse} \ProvidesExplPackage{fontspec-xetex}% - {2017/03/31}{2.6a}{Font selection for XeLaTeX and LuaLaTeX} + {2017/07/16}{2.6b}{Font selection for XeLaTeX and LuaLaTeX} \bool_new:N \l__fontspec_firsttime_bool \bool_new:N \l__fontspec_nobf_bool \bool_new:N \l__fontspec_noit_bool @@ -45,6 +45,8 @@ \bool_new:N \l__fontspec_ot_bool \bool_new:N \l__fontspec_mm_bool \bool_new:N \l__fontspec_graphite_bool +\bool_new:N \l__fontspec_fontcfg_bool +\bool_set_true:N \l__fontspec_fontcfg_bool \bool_new:N \g__fontspec_math_euler_bool \bool_new:N \g__fontspec_math_lucida_bool \bool_new:N \g__fontspec_pkg_euler_loaded_bool @@ -1050,6 +1052,8 @@ \__fontspec_if_detect_external:nT {#2} { \keys_set:nn {fontspec-preparse-external} {Path} } + \keys_set_known:nn {fontspec-preparse-cfg} {#1} + \__fontspec_init_ttc:n {#2} \__fontspec_load_external_fontoptions:Nn \l_fontspec_fontname_tl {#2} @@ -1106,16 +1110,19 @@ } } \cs_new:Nn \__fontspec_load_external_fontoptions:Nn - { - \__fontspec_sanitise_fontname:Nn #1 {#2} - \tl_set:Nx \l__fontspec_ext_filename_tl {#1.fontspec} - \tl_remove_all:Nn \l__fontspec_ext_filename_tl {~} - \prop_if_in:NVF \g__fontspec_fontopts_prop #1 - { - \exp_args:No \file_if_exist:nT { \l__fontspec_ext_filename_tl } - { \file_input:n { \l__fontspec_ext_filename_tl } } - } - } + { + \bool_if:NT \l__fontspec_fontcfg_bool + { + \__fontspec_sanitise_fontname:Nn #1 {#2} + \tl_set:Nx \l__fontspec_ext_filename_tl {#1.fontspec} + \tl_remove_all:Nn \l__fontspec_ext_filename_tl {~} + \prop_if_in:NVF \g__fontspec_fontopts_prop #1 + { + \exp_args:No \file_if_exist:nT { \l__fontspec_ext_filename_tl } + { \file_input:n { \l__fontspec_ext_filename_tl } } + } + } + } \cs_new:Nn \__fontspec_extract_all_features:n { \bool_if:NTF \l__fontspec_disable_defaults_bool @@ -1618,9 +1625,15 @@ \tl_clear:N \l__fontspec_punctspace_adjust_tl } \cs_set:Nn \__fontspec_iv_str_to_num:Nn - { - \__fontspec_iv_str_to_num:w #1 \q_nil #2 \c_empty_tl \c_empty_tl \q_nil - } + { + \__fontspec_strip_leading_sign:Nw #1#2 \q_nil + } +\cs_set:Npn \__fontspec_strip_leading_sign:Nw #1#2#3 \q_nil + { + \bool_if:nTF { \str_if_eq_p:nn {#2} {+} || \str_if_eq_p:nn {#2} {-} } + { \__fontspec_iv_str_to_num:w #1 \q_nil #3 \c_empty_tl \c_empty_tl \q_nil } + { \__fontspec_iv_str_to_num:w #1 \q_nil #2#3 \c_empty_tl \c_empty_tl \q_nil } + } \cs_set:Npn \__fontspec_iv_str_to_num:w #1 \q_nil #2#3#4#5#6 \q_nil { \int_set:Nn #1 @@ -1959,7 +1972,7 @@ \clist_set:Nn \g__fontspec_all_keyval_modules_clist { fontspec, fontspec-opentype, fontspec-aat, - fontspec-preparse, fontspec-preparse-external, fontspec-preparse-nested, + fontspec-preparse, fontspec-preparse-cfg, fontspec-preparse-external, fontspec-preparse-nested, fontspec-renderer } \cs_new:Nn \__fontspec_keys_define_code:nnn @@ -1971,6 +1984,14 @@ \__fontspec_keys_define_code:nnn {fontspec-addfeatures} {#1} { \__fontspec_error:nx {not-in-addfontfeatures} {#1} } } +\__fontspec_keys_define_code:nnn {fontspec-preparse-cfg} {IgnoreFontspecFile} + { + \bool_set_false:N \l__fontspec_fontcfg_bool + } +\__fontspec_keys_define_code:nnn {fontspec-preparse-external} {NoFontCfg} + { + \bool_set_false:N \l__fontspec_fontcfg_bool + } \__fontspec_keys_define_code:nnn {fontspec-preparse-external} {Path} { \bool_set_true:N \l__fontspec_nobf_bool @@ -2208,14 +2229,20 @@ \cs_new:Nn \__fontspec_calc_scale:n { \group_begin: - \rmfamily + + \fontencoding { \encodingdefault } + \fontfamily { \rmdefault } + \selectfont + \__fontspec_set_font_dimen:NnN \l__fontspec_tmpa_dim {#1} \font \__fontspec_set_font_dimen:NnN \l__fontspec_tmpb_dim {#1} \l_fontspec_font + \tl_gset:Nx \l__fontspec_scale_tl - { - \fp_eval:n { \dim_to_fp:n {\l__fontspec_tmpa_dim} / - \dim_to_fp:n {\l__fontspec_tmpb_dim} } - } + { + \fp_eval:n { \dim_to_fp:n {\l__fontspec_tmpa_dim} / + \dim_to_fp:n {\l__fontspec_tmpb_dim} } + } + \__fontspec_info:n {set-scale} \group_end: } @@ -3672,9 +3699,9 @@ } \prg_new_conditional:Nnn \__fontspec_if_merge_shape:n {TF} { - \bool_if:nTF + \bool_lazy_and:nnTF + { \tl_if_exist_p:c { \__fontspec_shape_merge:nn {\f@shape} {#1} } } { - \tl_if_exist_p:c { \__fontspec_shape_merge:nn {\f@shape} {#1} } && \cs_if_exist_p:c { \f@encoding/\f@family/\f@series/ |