I am finding that the fontspec package does not automatically correct the interword space after slanted text (\textsl{} or \slshape) even when I add \/ after the slant text. (Page 14 of the TeXbook recommands adding a slanted or italic correction after using slanted or italicized test.) I provide a MWE.
\documentclass{article}
\parindent=0pt
\usepackage{fontspec}
\setmainfont{Source Serif 4}[%Available for free on Google Fonts.
Kerning=On%
,SlantedFont={Source Serif 4}%\textsl{},\slscape
,SlantedFeatures={%
Kerning=On%
,FakeSlant=0.33%I use an exaggerated value to more clearly explain the issue.
}%
]
\begin{document}
Fontspec does \textsl{not} add the slant correction automatically.\\
\textsl{text} text\quad\textsl{hello world} hello world\\
\textsl{text\/} text\quad\textsl{hello world\/} hello world\\
Fontspec adds the italic correction automatically.\\
\textit{text} text\quad\textit{hello world} hello world\\
\textit{text\/} text\quad\textit{hello world\/} hello world\\
\end{document}
EDIT: I have worked on this issue and created the following macro, contained in the following MWE. The macro adds and calculates the extra spacing based off the height of the last slanted letter.
\documentclass{article}
\raggedright
\usepackage{xstring}
\usepackage{fontspec}
\setmainfont{Source Serif 4}[%Available for free on Google Fonts.
Kerning=On%
,SlantedFont={Source Serif 4}%\textsl,\slshsape
,SlantedFeatures={%
Kerning=On%
,FakeSlant=0.18
}
]
\newcommand\slantfactor{0.18}
\parindent=0pt
\newcommand{\textslant}[1]{%
\textsl{#1}%
\begingroup%
\sbox0{\StrRight{#1}{1}}%Requires package xstring.
\hspace{\fpeval{sin(atan(\slantfactor))}\ht0}%
\endgroup%
}
\begin{document}
\textsl{shell} helms\quad No Slant Correction\\
\textslant{shell} helms\quad With Slant Correction\\
shell helms\quad Regular Text\\
\textsl{bulk} helms\quad No Slant Correction\\
\textslant{bulk} helms\quad With Slant Correction\\
bulk helms\quad Regular Text\\
\textsl{quad} helms\quad No Slant Correction\\
\textslant{quad} helms\quad With Slant Correction\\
quad helms\quad Regular Text\\
\end{document}
EDIT: I've used the result in my other question to answer this question (hopefully I'm correct). See: Fontspec Slant Units

fp, plus\ExplSyntaxOn \cs_set_eq:NN \fpeval \fp_eval:n \ExplSyntaxOff– Cicada Nov 23 '22 at 12:18