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 | 60 |
1 files changed, 42 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty index c8a4e568aa7..e5f6bb5454e 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty @@ -31,7 +31,7 @@ \RequirePackage{expl3} \RequirePackage{xparse} \ProvidesExplPackage{fontspec-xetex}% - {2017/01/02}{2.5c}{Font selection for XeLaTeX and LuaLaTeX} + {2017/01/24}{2.5d}{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 @@ -124,7 +124,7 @@ \cs_generate_variant:Nn \keys_set_known:nnN {nx} \cs_generate_variant:Nn \prop_put:Nnn {Nxx} \cs_generate_variant:Nn \prop_put:Nnn {NxV} -\cs_generate_variant:Nn \prop_gput:Nnn {NxV} +\cs_generate_variant:Nn \prop_gput_if_new:Nnn {NxV} \cs_generate_variant:Nn \prop_gput:Nnn {Nxn} \cs_generate_variant:Nn \prop_get:NnNT {NxN} \cs_generate_variant:Nn \prop_get:NnNTF {NxN} @@ -916,9 +916,28 @@ { \exp_args:Nxx \tl_if_in:nnTF { \fontname\font } { \tl_to_str:n {#1} } - { \prg_return_true: } { \prg_return_false: }% + { \prg_return_true: } { \prg_return_false: } } +\prg_new_conditional:Nnn \fontspec_if_small_caps: {TF,T,F} + { + \__fontspec_if_merge_shape:nTF {sc} + { + \tl_set_eq:Nc \l__fontspec_smcp_shape_tl { \__fontspec_shape_merge:nn {\f@shape} {sc} } + } + { + \tl_set:Nn \l__fontspec_smcp_shape_tl {sc} + } + \cs_if_exist:cTF { \f@encoding/\f@family/\f@series/\l__fontspec_smcp_shape_tl } + { + \tl_if_eq:ccTF + { \f@encoding/\f@family/\f@series/\l__fontspec_smcp_shape_tl } + { \f@encoding/\f@family/\f@series/\updefault } + { \prg_return_false: } + { \prg_return_true: } + } + { \prg_return_false: } + } \cs_new_protected:Nn \__fontspec_select_font_family:nn { \group_begin: @@ -1430,7 +1449,7 @@ } } } -\clist_set:Nn \l__fontspec_pre_feat_sclist +\tl_set:Nn \l__fontspec_pre_feat_sclist { \bool_if:NT \l__fontspec_ot_bool { @@ -3515,19 +3534,24 @@ \tl_const:cn { \__fontspec_shape_merge:nn \itscdefault \updefault } {\scdefault} \tl_const:cn { \__fontspec_shape_merge:nn \slscdefault \updefault } {\scdefault} \cs_new:Nn \fontspec_merge_shape:n - { - \bool_if:nTF - { - \tl_if_exist_p:c { \__fontspec_shape_merge:nn {\f@shape} {#1} } && - \cs_if_exist_p:c - { - \f@encoding/\f@family/\f@series/ - \tl_use:c { \__fontspec_shape_merge:nn {\f@shape} {#1} } - } - } - { \fontshape { \tl_use:c { \__fontspec_shape_merge:nn {\f@shape} {#1} } } \selectfont } - { \fontshape {#1} \selectfont } - } + { + \__fontspec_if_merge_shape:nTF {#1} + { \fontshape { \tl_use:c { \__fontspec_shape_merge:nn {\f@shape} {#1} } } \selectfont } + { \fontshape {#1} \selectfont } + } +\prg_new_conditional:Nnn \__fontspec_if_merge_shape:n {TF} + { + \bool_if:nTF + { + \tl_if_exist_p:c { \__fontspec_shape_merge:nn {\f@shape} {#1} } && + \cs_if_exist_p:c + { + \f@encoding/\f@family/\f@series/ + \tl_use:c { \__fontspec_shape_merge:nn {\f@shape} {#1} } + } + } + \prg_return_true: \prg_return_false: + } \DeclareRobustCommand \itshape { \not@math@alphabet\itshape\mathit @@ -3557,7 +3581,7 @@ \clist_map_inline:nn {\emreset,#1} { ##1 - \prop_gput:NxV \g__fontspec_em_prop { \f@series/\f@shape } { \l__fontspec_emdef_int } + \prop_gput_if_new:NxV \g__fontspec_em_prop { \f@series/\f@shape } { \l__fontspec_emdef_int } \prop_gput:Nxn \g__fontspec_em_prop { switch-\int_use:N \l__fontspec_emdef_int } { ##1 } \int_incr:N \l__fontspec_emdef_int } |