[lltx] Problem with slanted fonts

Khaled Hosny khaledhosny at eglug.org
Sun Sep 19 18:50:09 CEST 2010


On Sun, Sep 19, 2010 at 04:24:52PM +0200, Ulrike Fischer wrote:
> Am Sun, 19 Sep 2010 14:37:31 +0300 schrieb Khaled Hosny:
> 
> > On Sun, Sep 19, 2010 at 01:27:38PM +0200, Ulrike Fischer wrote:
> >> 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.
> > 
> > So, how XeTeX is dealing with this? If its behaviour can be emulated in
> > luaotfload then we should do it, else it might be something for LuaTeX
> > to handle.
> 
> I have no idea how xetex is going around. But I found the place
> where it fails: in \do at subst@correction. A failing example gives
> this with tracingmacros =1 :
> 
> 
> EU2/testfam/m/n -><->"name:Lucida Sans" 
> 
> <->"name:Lucida Sans" ->
> 
> \subst at correction ->\EU2/testfam/m/it/10 \global \font
> \EU2/testfam/m/n/10 \fontname \font \relax 
> luaotfload | Updating the font names database:
> luaotfload | Scanning TEXMF and OS fonts...
> ... and then error
> 
> A non failing shows this (notice the missing space!):
> 
> EU2/testfam/m/n -><->"name:LucidaSans" 
> 
> <->"name:LucidaSans" ->
> 
> \subst at correction ->\EU2/testfam/m/it/10 \global \font
> \EU2/testfam/m/n/10 \fontname \font \relax 
> luaotfload | load font: font family='lucidasans',
> subfamily='regular' found: lsans.ttf

How I forgot that! internally, "Lucida Sans", "LucidaSans",
"lucidasans", "L U ci DaS anS" all are the same to luaotfload, we will
strip spaces and lower case font name before doing matching. So fontspec
can just strip the spaces in some way (if not easy in tex, can be done
in lua).

Regards,
 Khaled

-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer


More information about the lualatex-dev mailing list