Skip to content

Commit

Permalink
\@@_declare_shapes_smcaps:nn setup a slsc -> itsc substitution
Browse files Browse the repository at this point in the history
If a slanted font is not provided, fontspec setup automatic `sl -> it`
substitutions in `\@@_declare_shape_slanted:nn`. But if a small caps
font was provided, an `itsc` shape is defined but there is no
corresponding `slsc -> itsc` substitution.

Fix this by adapting the code of `\@@_declare_shape_slanted:nn` into
`\@@_declare_shapes_smcaps:nn`.
  • Loading branch information
Damien Robert committed Jun 16, 2020
1 parent 63577fe commit 39fe331
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions fontspec-code-internal.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -815,13 +815,24 @@
% \end{macro}
%
% \begin{macro}{\@@_declare_shapes_smcaps:nn}
% We set up a smallcaps font if it has been provided. If the current shape
% is `it', we also set up a `slsc -> itsc` substitution, like in \verb|\@@_declare_shape_slanted:nn|.
% \begin{macrocode}
\cs_new:Nn \@@_declare_shapes_smcaps:nn
{
\tl_if_empty:NF \l_@@_nfss_sc_tl
{
\@@_DeclareFontShape:xxxxxx {\g_@@_nfss_enc_tl} {\g_@@_nfss_family_tl} {#1}
{ \@@_combo_sc_shape:n {#2} } {\l_@@_nfss_sc_tl} {\l_@@_postadjust_tl}
\bool_if:nT
{
\str_if_eq_p:ee {#2} {\itdefault} &&
!(\str_if_eq_p:ee {\itscdefault} {\slscdefault})
}
{
\@@_DeclareFontShape:xxxxxx {\g_@@_nfss_enc_tl}{\g_@@_nfss_family_tl}{#1}{\slscdefault}
{<->ssub*\g_@@_nfss_family_tl/#1/\itscdefault}{\l_@@_postadjust_tl}
}
}
}
% \end{macrocode}
Expand Down

0 comments on commit 39fe331

Please sign in to comment.