[lltx] Problem with slanted fonts

Ulrike Fischer news3 at nililand.de
Sun Sep 19 13:27:38 CEST 2010


Am Sat, 18 Sep 2010 15:58:37 +0930 schrieb Will Robertson:


>>> I have installed TexLive 2010 and am trying out Lualatex.
>>> When typesetting the following example:
>>> 
>>> \documentclass{article}
>>> \usepackage{fontspec}
>>> \setmainfont{Gentium Basic}
>>> \begin{document}
>>> \textsl{hello}
>>> \end{document}
>>> 
>>> the resulting pdf file contains the following line:
>>> 
>>> Basic/I:mode=node;script=latn;language=DFLT;hello
>>> 
>>> I wouldn't expect to find the font features in there...
>>> What am I doing wrong here?
>> 
>> Nothing. It is a bug, due to the space in the font name. 
>> 
>> Until the bug is repaired you can remove the space from the font
>> name (GentiumBasic), or you can use \textit instead of \textsl. This
>> will give the same result anyway as long as you don't use the
>> SlantedFont-option to declare a specific slanted font. 
 
> I've been trying to track down the origin of this bug and so far
> I'm out of luck. 

I have tracked it a bit down. The source is 1. that \slshape use sub
in \DeclareFontShape and 2. that the "font declaration" is stored in
a command. The result depends also on the actual font. In the
following example Times New Roman gives "only" some unwanted text in
the pdf (because "Times" is the name of an existing font too), while
Lucida gives directly an error (! Font
\EU2/testfam/m/n/10=name:Lucida not loadable:). Attention: If you
use both method (with and without command \fontdesc) for the same
font they can be side effect.



\documentclass{article}

\usepackage{luaotfload}


\DeclareFontEncoding{EU2}{}{}
\DeclareErrorFont{EU2}{lmr}{m}{n}{10}
\DeclareFontSubstitution{EU2}{lmr}{m}{n}

\newcommand\fontdesc{<-> "name:Times New
Roman:mode=node;script=latn;language=DFLT;"}
\renewcommand\fontdesc{<-> "name:Lucida
Sans:mode=node;script=latn;language=DFLT;"}
\DeclareFontFamily{EU2}{testfam}{}
\DeclareFontShape {EU2}{testfam}{m}{n}
        {\fontdesc}{}
\DeclareFontShape {EU2}{testfam}{m}{it}
        {<->sub * testfam/m/n}{}


%\DeclareFontFamily{EU2}{testfamb}{}
%\DeclareFontShape {EU2}{testfamb}{m}{n}
%        {<-> "name:Lucida
%Sans:mode=node;script=latn;language=DFLT;"}{}
%\DeclareFontShape {EU2}{testfamb}{m}{it}
%        {<->sub * testfamb/m/n}{}


\DeclareFontFamily{EU2}{testfamb}{}
\DeclareFontShape {EU2}{testfamb}{m}{n}
        {<-> "name:Times New
Roman:mode=node;script=latn;language=DFLT;"}{}
\DeclareFontShape {EU2}{testfamb}{m}{it}
        {<->sub * testfamb/m/n}{}


\begin{document}

\fontencoding{EU2}

{\fontfamily{testfam}\selectfont fam\\
 \fontshape{it}\selectfont abc}


\fontfamily{testfamb}\selectfont famb\\
\fontshape{it}\selectfont abc

\end{document}



-- 
Ulrike Fischer 



More information about the lualatex-dev mailing list