[XeTeX] fontspec loading the wrong font?

Ross Moore ross.moore at mq.edu.au
Thu Dec 15 22:56:34 CET 2011


Hello Daniel,

On 16/12/2011, at 8:43 AM, Daniel Greenhoe wrote:

> I have run into a very strange problem when using fontspec and trying
> to test a new experimental version of GNU FreeSerif. In particular,
> suppose I try labeling the old FreeSerif as \fntFreeSerif and the new
> experimental FreeSerif as \fntFreeSerifx like this:

try doing some detailed tracing, using  \tracingall

{\tracingall % detailed trace of just the next 2 top-level commands
> \newfontfamily{\fntFreeSerif}[
>   ExternalLocation,
>   Path           = {/xfonts/gnuFreeFont/},
>   Extension      = {.otf},
>   UprightFont    = {*},
>   BoldFont       = {*Bold},
>   ItalicFont     = {*Italic},
>   BoldItalicFont = {*BoldItalic},
>   ]{FreeSerif}
> 
> \newfontfamily{\fntFreeSerifx}[
>  ExternalLocation,
>  Path           = {/xfonts/gnuFreeFont/2011dec12/},
>  Extension      = {.ttf},
>  UprightFont    = {*},
>  BoldFont       = {*Bold},
>  ItalicFont     = {*Italic},
>  BoldItalicFont = {*BoldItalic},
>  ]{FreeSerif}
} % closing delimiter to restrict the scope of \tracingall


Then study the .log file output.
There will be *masses* of extra output lines, most of which
is quite irrelevant to your needs.
nevertheless, you may be able to spot where something is obviously
Not how you would like it to be.

> 
> Then XeLaTeX seems to get confused and does not seem to find the new
> \fntFreeSerifx font, but is maybe using \fntFreeSerif or another
> version of FreeSerif, perhaps one in my Texlive setup.
> 
> In the log file, both fonts are assigned the same label FreeSerif(0):
> 
> . Font family 'FreeSerif(0)' created for font 'FreeSerif' with options [
> . ExternalLocation, Path = {/xfonts/gnuFreeFont/}, Extension = {.otf},
> . UprightFont = {*}, BoldFont = {*Bold}, ItalicFont = {*Italic},
> . BoldItalicFont = {*BoldItalic}, ].
> 
> . Font family 'FreeSerif(0)' created for font 'FreeSerif' with options [
> . ExternalLocation, Path = {/xfonts/gnuFreeFont/2011dec12/}, Extension =
> . {.ttf}, UprightFont = {*}, BoldFont = {*Bold}, ItalicFont = {*Italic},
> . BoldItalicFont = {*BoldItalic}, ].
> 
> 
> But if I comment out any *one* (or all four) of the shape directive
> lines like this
> 
> \newfontfamily{\fntFreeSerifx}[
>  ExternalLocation,
>  Path           = {/xfonts/gnuFreeFont/2011dec12/},
>  Extension      = {.ttf},
>   UprightFont    = {*},
>   BoldFont       = {*Bold},
>   ItalicFont     = {*Italic},
> %   BoldItalicFont = {*BoldItalic},
>  ]{FreeSerif}
> 
> then the problem goes away, and the two fonts are given different labels:
> 
> . Font family 'FreeSerif(0)' created for font 'FreeSerif' with options [
> . ExternalLocation, Path = {/xfonts/gnuFreeFont/}, Extension = {.otf},
> . UprightFont = {*}, BoldFont = {*Bold}, ItalicFont = {*Italic},
> . BoldItalicFont = {*BoldItalic}, ].
> 
> . Font family 'FreeSerif(1)' created for font 'FreeSerif' with options [
> . ExternalLocation, Path = {/xfonts/gnuFreeFont/2011dec12/}, Extension =
> . {.ttf}, UprightFont = {*}, BoldFont = {*Bold}, ItalicFont = {*Italic}, ].
> 
> Is this something I am doing wrong, a fontspec bug, or a problem with
> FreeSerif and variants?

The .log output using  \tracingall  may offer some clues to help
someone to answer this question.

> 
> Many thanks in advance,
> Dan


Hope this helps,

	Ross

------------------------------------------------------------------------
Ross Moore                                       ross.moore at mq.edu.au 
Mathematics Department                           office: E7A-419      
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------





More information about the XeTeX mailing list