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?
\font\test="[C:/Windows/fonts/XXX]" \test abc
.