[tex-live] Fontconfig for XeTeX versus regular fontconfig

Khaled Hosny khaledhosny at eglug.org
Thu Oct 27 16:43:16 CEST 2011


On Thu, Oct 27, 2011 at 03:18:15PM +0100, Philip TAYLOR (Webmaster, Ret'd) wrote:
> 
> 
> Ulrike Fischer wrote:
> 
> >The problem exists in various variants also on miktex.
> >xetex/xdvipdfmx got confused because of different versions of an
> >otf-font in system/texmf, because of otf + ttf versions, even
> >because of otf + type1 versions.
> >
> >>The right answer here is to fix XeTeX.
> >
> >Yes, it would be really useful if the communication between xetex
> >and xdvipdfmx could be improved in this respect - or at least if
> >they would search fonts in the same way. And if one could tell
> >xetex/xdvipdfmx to prefer e.g. otf- over ttf-fonts.
> 
> I have that problem here, and it was the very devil to
> identify.  This was my original source :
> 
> \font \ornatefont = "Script MT Bold" at 48 pt
> \font \leadfont = "GaramondPremrPro-MedCapt" at 36pt
> \font \subleadfont = "GaramondPremrPro-MedItCapt" at 28pt
> \font \clubfont = "GaramondPremrPro-MedCapt" at 31pt
> \font \bodyfont = "GaramondPremrPro-MedCapt" at 26pt
> 
> but when I ran it, the PDF contained not GaramondPremrPro-MedCapt
> at all, but instead GaramondPremrPro-MedDisp -- ugly as hell,

This might be related to the automatic optical size selection which
takes the requested font size into account. Explicitly selecting an
optical size might help, say "GaramondPremrPro-MedItCapt/S=10" (not sure
about the right syntax, though).

> with great disparity between caps height and x-height.  I could
> /not/ work out why.  Eventually, in desperation, I tried something
> I remembered from a previous XeTeX project :
> 
> 
> \font \ornatefont = "Script MT Bold" at 48 pt
> \font \leadfont = "[GaramondPremrPro-MedCapt]" at 36pt
> \font \subleadfont = "[GaramondPremrPro-MedItCapt]" at 28pt
> \font \clubfont = "[GaramondPremrPro-MedCapt]" at 31pt
> \font \bodyfont = "[GaramondPremrPro-MedCapt]" at 26pt
> 
> and all of a sudden, I had the right fonts.

Selecting font by file name (which is what the square brackets does) is
always the most precise way as there is no smartness at XeTeX end (and
since you are using low level font commands, loading fonts by font name
has almost no practical advantage apart from not having to install fonts
into TEXMF tree).

> When I came look for all instances of Garamond on my system,
> I had zillions : not only the real thing, from a reputable
> font supplier, and installed in my system font directory,
> but also multiple copies lurking in the TeX hierarchy :
> Garamond TFMs, Garamond VFs, Garamond AFMs, Garamond PFBs,
> Garamond PFMs, and probably more besides.

Only PFBs from those would have an effect here, the others are ignored.
TFMs are only used when using the old TeX font loading syntax (no
quotation marks).

> No wonder poor old XeTeX was confused.  What to do ?
> I don't know.  Fonts are not my forte.  But if XeTeX
> can be asked to use GaramondPremrPro-MedCapt and ends
> up using GaramondPremrPro-MedDisp because of something
> nasty lurking in the TeX Live installation, then I don't
> think that "Fix XeTeX" is necessarily the right approach
> (although it might help, if there were expertise and manpower
> available to do so).  But we also need to look into TeX Live
> and see how it is that components of TeX Live that come as
> standard can trick XeTeX into using the wrong font.

Your issue is a bit different than the other one, here xetex and
xdvipdfmx are consistently loading the same font, though it might not be
the one you want (might even be a "feature" of some sort), but in the
issue Karl is commenting on each is loading a different font, which
should not happen.

Regards,
 Khaled


More information about the tex-live mailing list