-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asterisk (*) in listings environment becomes lower #324
Comments
AFAIK this issue has nothing to do with fontspec. It is the black magic of the listings package. We can see the following code fragment in \lst@CCPutMacro
...
\lst@ProcessOther {"2A}{\lst@ttfamily*\textasteriskcentered}
...
\@empty\z@\@empty
\def\lst@ttfamily#1#2{\ifx\f@family\ttdefault#1\relax\else#2\fi} The definition of \DeclareTextCommand{\textasteriskcentered}\UnicodeEncodingName{%
\iffontchar\font"2217 \char"2217 \else
\begingroup
\fontsize
{\the\dimexpr1.2\dimexpr\f@size pt\relax}%
{\f@baselineskip}%
\selectfont
\raisebox{-0.6ex}[\dimexpr\height-0.6ex][0pt]{*}%
\endgroup
\fi
} |
Everything goes OK after loading the |
\DeclareUTFcharacter[\UTFencname]{x002A}{\textasteriskcentered} |
Interesting discussion but I agree this isn't a fontspec issue. |
Consider the following code:
The result is
Notice that the asterisk is lower when using
\CodeFont
, but it's normal for\ttfamily
.I have tried other fonts. This issue appears when using Fira Code, Libertinus Mono etc, but doesn't show for CMU Typewriter.
Another test for Lucida Sans Unicode, however, shows that the asterisk (
U+002A
) becomes math asterisk (U+2217
) improperly:The text was updated successfully, but these errors were encountered: