[XeTeX] fontspec loading the wrong font?

Daniel Greenhoe dgreenhoe at gmail.com
Thu Dec 15 22:43:18 CET 2011


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:

 \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}

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?

Many thanks in advance,
Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scshape.tex
Type: application/x-tex
Size: 3229 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20111216/8a96a2a9/attachment-0001.tex>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scshape.log
Type: application/octet-stream
Size: 30941 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20111216/8a96a2a9/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scshape.pdf
Type: application/pdf
Size: 32151 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20111216/8a96a2a9/attachment-0001.pdf>


More information about the XeTeX mailing list