# [lltx] Problem with slanted fonts

Ulrike Fischer news3 at nililand.de
Mon Sep 20 14:00:16 CEST 2010

Am Mon, 20 Sep 2010 20:28:55 +0930 schrieb Will Robertson:

> On 20/09/2010, at 8:22 PM, Ulrike Fischer wrote:
>
>> Well I tried this redefinition and it worked fine with lualatex
>> (only with lualatex! pdflatex and xelatex don't like the additional
>> braces).
>>
>> \makeatletter
>> \def\do at subst@correction{%
>>       \xdef\subst at correction{%
>>          \font at name
>>          \global\expandafter\font
>>            \csname \curr at fontshape/\f at size\endcsname
>>            {\noexpand\fontname\font} %<--- braces
>>           \relax}%
>>       \aftergroup\subst at correction
>> }
>>
>> So braces are probably ok.
>
> Thanks for doing this.
>
> What are your thoughts on the preferable approach?

> If we strip spaces beforehand then we know that we won't fall foul
> of any related problems with \fontname; if we patch the NFSS then
> the approach will be robust for other people's code that also
> falls foul of the same problem.

I only patched \do at subst@correction to check if braces, bracket and
quotes around the fontname solves the problem. I don't think that
this patch is in itself a good solution. I also don't think that
changing fontspec is the right way.

I think \fontname\font should give something back, that luatex
accepts as fontname. So this should work also with fonts like Lucida
Sans:

\documentclass{article}
\usepackage{luaotfload}
\begin{document}
%\font\testa="name:Lucida Sans" \testa

abc \font\test=\fontname\font\space at 15pt \test abc
\end{document}

So at my opinion luaoftload or whoever is responsable for the syntax
of \fontname should be adapted. I don't know enough of the syntax
regarding quotes, braces, brackets to be able to make a suggestion
which is the best.

--
Ulrike Fischer



More information about the lualatex-dev mailing list