5

I have a directory containing a Type 1 Sabon font I want to use in Xelatex. I want to use the font by specifying the filenames using the fontspec package. I specifically define the bold and italic fonts as suggested in the fontspec manual. \setmainfont can take the same options as \fontspec, so I write:

    \documentclass[11pt, BCOR=0mm, DIV=default]{scrartcl}
    \usepackage{fontspec}
    \usepackage{xunicode}
    \usepackage{xltxtra}
    \usepackage{polyglossia}
    \setmainlanguage{english}
   \setmainfont[Path=C:/fonts/, BoldFont=LTe50385.pfb ,ItalicFont=LTe50383.pfb]    
    {LTe50383.pfb}
            \begin{document}
            etc
            \end{document}

After trying to compile this i get the following errors

Font \zf@basefont="[C:/fonts/LTe50383.pfb ]/IC

    U" at 10.0pt not loadable: Metric (TFM) file or installed font n
    ot found.
    <to be read again> 
                       \scan_stop: 
    l.7 ..., ItalicFont = LTe50383.pfm]{LTe50383.pfm }

    I wasn't able to read the size data for this font,
    so I will ignore the font specification.
    [Wizards can fix TFM files using TFtoPL/PLtoTF.]
    You might try inserting a different font spec;
  • Because of the error above I wonder if it is at all possible to load a Type 1 (Postscript) font in this way or is it restricted to OpenType and others. since it keeps asking for the TFM metric files. The Type 1 Metric files (.pfm) are placed in the same directory, but how does fontspec know how to use those?

  • Or Am I doing something else wrong?

All help is much appreciated!


Edit 1

I'm able to use the fonts I want after installing them on the windows machine. However, this is not something I prefer, as at my workcomputer I'm unable to install fonts properly. So this problem is directly related to using the fonts by loading the diskfiles.


Edit 2

The following test returns without errors:

\begin{document}
\font\test="[C:/fonts/LTe50383.pfb]" \test abc \par
\font\test="[C:/fonts/LTe50384.pfb]" \test abc \par
\font\test="[C:/fonts/LTe50385.pfb]" \test abc \par
\end{document}

Edit 3

It seems Xelatex automatically tries to find the best replacements for the unloadable font that are loaded on the machine, therefore giving some confusing false-positive results when trying to load fonts from diskfile directly using:

\setmainfont[Path=C:/fonts/, BoldFont=LTe50385.pfb ,ItalicFont=LTe50383.pfb]    
        {LTe50383.pfb}

Edit 4

Owhman, this is getting confusing :) It seems syntax related, as the tests in Edit 2, meaning that Type 1 fonts can be loaded using diskfiles. Who helps me correct my syntax?


Edit 5

The following works fine

\setmainfont[Path=C:/fonts/]{LTe50383.pfb}

and also using the diskfile to set a fontfamily works without problems:

\newfontfamily\scfont[Path=C:/fonts/]{SARSC___.PFB}

Meaning that I seem to be doing something wrong, and I shouldnt add fontfeatures such as BoldFont = and ItalicFont = to the \setmainfont option. Or should this be possibly and is this a bug in fontspec?

10
  • Seems to be working for me; what version of XeTeX/fontspec are you using? Commented Dec 6, 2010 at 12:57
  • Although I've never tested fontspec with PostScript fonts before; I see that some things aren't working so well/at all. Commented Dec 6, 2010 at 13:03
  • In theory xetex can use type1 fonts directly but I don't know for sure if it can handle pfm or if it needs an afm. At first I would try to install the fonts in the windows system fonts folder (e.g. by copying the pfm/pfb). Don't use fontspec but try at first with the low-level command \font\test="[C:/Windows/fonts/XXX]" \test abc. Commented Dec 6, 2010 at 15:37
  • I think my system works fine. I installed the fonts at home, and I can use the fonts in xetex without any problems, meaning that indeed Type 1 fonts can be directly loaded. Because at work I cannot install fonts for some reason, I want to use the fonts directly from disk, so that's why I'm trying this load from file method.
    – Timtico
    Commented Dec 6, 2010 at 19:29
  • 1
    I think this might be a fontspec bug but I'm going on holidays soon and I won't be able to look into it until next year... Commented Dec 6, 2010 at 22:18

1 Answer 1

2

There is a workaround for not being able to install fonts on Windows: if you load them in the font viewer, other applications will be able to use them too, until you close the font viewer. I just checked, and it is possible to do this with Type 1 fonts: just double click on the .pfm file (which, unlike the .pfb file, will have a nice fonty icon).

1
  • well the most convenient workaround (and that is what I'm doing ) is using the font diskfiles directly, however, that usage appears to be abit buggy on my machine as I'm unable to define boldfont = and italicfont = and such when using \setmainfont{} (might be a bug in fontspec)
    – Timtico
    Commented Dec 8, 2010 at 21:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .