[XeTeX] cannot get Hoefler text to work with XeTeX

Jonathan Kew jfkthame at googlemail.com
Wed Mar 18 15:34:33 CET 2009

On 18 Mar 2009, at 14:20, Rolf Schmolling wrote:

> Hi,
> I am a newby to XeTeX though I have successfully used it to some
> extend in recent past.
> Now when I try to use Hoefler text in a document, I get the following
> error:
> ***
> Invalid fontname `Hoefler Text ', contains ' '

This message comes from mktextfm, trying to create a tfm on-the-fly as  
the font was not found. Of course, that would fail (as there's no  
metafont source) even if it wasn't unhappy with the name.

> \defaultfontfeatures{Mapping=tex-text}
> \setmainfont[Mapping=tex-text, Numbers=OldStyle]{
> Hoefler Text%
> }

Hmmm... this is suspicious; you have a newline (which is normally  
treated like a space) at the beginning of the font name, within  
\setmainfont{}. I'd be worried about that, as the font is named  
"Hoefler Text" and not " Hoefler Text".

> ! Font \zf at basefont=" Hoefler Text" at 10.0pt not loadable: Metric
> (TFM) file o
> r installed font not found.

Sure enough, that newline (converted to space) is appearing as part of  
the quoted name that xetex is told to find. No wonder it fails.

Moral: don't add random whitespace within names! If you really want a  
newline there in your source, use % to comment it out so that TeX  
doesn't see it.


More information about the XeTeX mailing list