diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty | 71 |
1 files changed, 49 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty index 662376bb378..f28ab55f99a 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty @@ -32,7 +32,7 @@ \RequirePackage{expl3} \RequirePackage{xparse} \ProvidesExplPackage{fontspec-luatex}% - {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 @@ -1053,6 +1055,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} @@ -1110,16 +1114,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 @@ -1585,9 +1592,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 @@ -1838,7 +1851,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 @@ -1850,6 +1863,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 @@ -2084,14 +2105,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: } @@ -3396,9 +3423,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/ |