[XeTeX] Combining NFSS fonts and OTF fonts with XeLaTeXand fontspec

Ulrike Fischer news3 at nililand.de
Tue Jun 9 16:44:28 CEST 2009

Am Tue, 9 Jun 2009 13:21:26 +0200 schrieb Zwam, S.H.M. van:

> I probably did not make myself clear. I want to use the "Charis SIL" font (actually, another font that I intend to purchase, but let's keep things simple) for my regular text, bold, and small caps, but the font specified by mathdesign for italic and bold italic. These fonts are provided in my MikTeX installation, in the folders
> fonts\type1\bitstrea\charter\bchri8a.pfb
> and
> fonts\tfm\bitstrea\charter\bchri7t.tfm (and several other .tfm files, with last two characters 8c, 8r, 8t).
> I do not know how to specify this font to ItalicFont. The following code in my document:
>  \usepackage[no-math]{fontspec}
>  \usepackage{xunicode}
>  \usepackage{xltxtra}
> \usepackage[bitstream-charter]{mathdesign}
> \setmainfont[ItalicFont={bchri}]{Charis SIL}
> Gives the following error message:

At first I would always load other font packages before fontspec so
that they can't overwrite settings. 

At second if you want to use a font throught the fontspec commands
you must use their real font names, not the tfm-names. 

\setmainfont[ItalicFont={Bitstream Charter Italic}]{Charis SIL}

This will use the pfb (at least with miktex where xetex can use
fonts in texmf-tree). But it won't work well, an old pfb is not the
same as a modern otf and xetex has sometimes troubles to use them
directly. E.g. umlauts gives errors.

You can also switch temporarly to T1-encoding to use the font. This
will work as with e.g. pdflatex as long as you pay attention to the
input as not every non-ASCII chars will give the expected output:


\setmainfont[ItalicFont={Bitstream Charter Italic}]{Charis SIL}
abc \itshape abc %äöü don't work

{\fontencoding{T1}\fontfamily{bch}\itshape abc  äöüß  \"a \"u \"o


Ulrike Fischer 

More information about the XeTeX mailing list