[XeTeX] lmsans font [was: from teTeX-3.0 to TeXLive 2007]
Bruno Voisin
bvoisin at mac.com
Wed Aug 22 10:08:13 CEST 2007
Le 22 août 07 à 04:56, Mike Maxwell a écrit :
> [...]
> \usepackage{fontspec}
> \setmainfont{Charis SIL}
> [...]
>
> But I'm still getting the following warning msg:
> Missing character: There is no ʃ in font [lmsans10-bold]!
> In case the missing char doesn't show up in your email, it's an IPA
> character. It is present in the Charis SIL font, but apparently
> not in
> the lmsans font. The warnings appear to be triggered on section
> titles,
> and indeed for this particular section, the IPA character is
> missing in
> the PDF.
>
> What I can't figure out is why, when I've told it to use the Charis
> SIL
> font, it still insists on using the lmsans font in section headings.
There must be something in the class file or one of the style files
used by your document which says that section titles are in \sffamily
\bfseries -- or \textsf{\textbf{. \setmainfont sets only the font for
the serif family (Times-like), you need \setsansfont for setting the
font for the sans-serif family (Helvetica-like), and \setmonofont for
setting the font for the monospaced family (Courier-like).
You would need something like:
\usepackage{fontspec,xunicode,xltxtra}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\setmainfont{Charis SIL}
\setsansfont{Charis SIL}
\setmonofont{Courier} % or whichever monospaced font of your liking
That said, it would be even better to use a truly sans-serif font for
\setsansfont, and instead to redefine the section command in your
class file to avoid titles using sans-serif. Something like, in the
preamble of your document:
\makeatletter
\renewcommand{\subsection}{\@startsection{subsection}{2}{0pt}%
{-2.25ex plus -1ex minus -.2ex}{1ex plus .2ex}%
{\centering\normalfont\normalsize\itshape}}
\makeatother
Namely, take the \section command definition from your class file,
copy it, paste it in the preamble of your document, sandwiched
between \makeatletter and \makeatother, replace \newcommand if any by
\renewcommand, and then erase the \sffamily or \textsf{ instruction
which must be hanging out somewhere.
Hope this helps,
Bruno Voisin
More information about the XeTeX
mailing list