I want to declare more than one font so XeTeX can use other fonts when first font did not have a specific glyph. How can I do that? In windows when the current font does not have a glyph, other font are used to show that glyph.(e.g. I want insert tick (✓) directly, not with \Checkmark
)
I know that I can use a Unicode font like code2000 but as you know this kind of fonts generally are not pretty enough.
\documentclass{article}
\usepackage{bbding}
\begin{document}
\section{NOK}
(✓) (✗)
\section{OK}
(\Checkmark ) (\XSolidBrush)
\end{document}
\documentclass{article}
\usepackage{bbding}
\usepackage{fontspec}
\setmainfont{Arial Unicode MS}
\begin{document}
\section{OK}
(✓) (✗)
\section{OK}
(\Checkmark ) (\XSolidBrush)
\end{document}
At least I want to specify two fonts (e.g.\setfont{Arial,Code200}
) ,a main font and a Unicode one so it can be used for missed glyphs.
Best Answer
Using two (or more) fonts in XeLaTeX (or LuaLaTeX) is very easy, since the
fontspec
package which handles fonts for those engines provides commands for loading new fonts and assigning macro names to them.What you cannot do is have automatic switching from one font to another if XeTeX fails to find a glyph in a particular font.
Here's an example of font switching used for inserting phonetic characters (which many fonts don't have). The standard font that linguists use for phonetics is Doulos SIL. You can use it in XeLaTeX in the following way:
In your new example using checkmarks and crosses, you can do things similarly. Here I've used Arial Unicode MS and Zapf Dingbats to show two different versions of these characters (I don't have the Code2000 font). But the principle is exactly the same.