diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/fontspec/fontspec-patches.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/fontspec/fontspec-patches.dtx | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-patches.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-patches.dtx index 7114a8af2ea..44d9f52fd2c 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-patches.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-patches.dtx @@ -45,19 +45,28 @@ % If not found, fall back on the `new' shape. % \begin{macrocode} \cs_new:Nn \fontspec_merge_shape:n - { - \bool_if:nTF - { - \tl_if_exist_p:c { \@@_shape_merge:nn {\f@shape} {#1} } && - \cs_if_exist_p:c - { - \f@encoding/\f@family/\f@series/ - \tl_use:c { \@@_shape_merge:nn {\f@shape} {#1} } - } - } - { \fontshape { \tl_use:c { \@@_shape_merge:nn {\f@shape} {#1} } } \selectfont } - { \fontshape {#1} \selectfont } - } + { + \@@_if_merge_shape:nTF {#1} + { \fontshape { \tl_use:c { \@@_shape_merge:nn {\f@shape} {#1} } } \selectfont } + { \fontshape {#1} \selectfont } + } +% \end{macrocode} +% The following is rather specific; it only returns true if the merged shape exists, +% but more importantly also if the merged shape is defined for the current font. +% \begin{macrocode} +\prg_new_conditional:Nnn \@@_if_merge_shape:n {TF} + { + \bool_if:nTF + { + \tl_if_exist_p:c { \@@_shape_merge:nn {\f@shape} {#1} } && + \cs_if_exist_p:c + { + \f@encoding/\f@family/\f@series/ + \tl_use:c { \@@_shape_merge:nn {\f@shape} {#1} } + } + } + \prg_return_true: \prg_return_false: + } % \end{macrocode} % \end{macro} % @@ -108,7 +117,7 @@ \clist_map_inline:nn {\emreset,#1} { ##1 - \prop_gput:NxV \g_@@_em_prop { \f@series/\f@shape } { \l_@@_emdef_int } + \prop_gput_if_new:NxV \g_@@_em_prop { \f@series/\f@shape } { \l_@@_emdef_int } \prop_gput:Nxn \g_@@_em_prop { switch-\int_use:N \l_@@_emdef_int } { ##1 } \int_incr:N \l_@@_emdef_int } |