[XeTeX] Detect, whether a font contains a certain character

Tobias Schoel liesdiedatei at googlemail.com
Mon Nov 28 10:44:08 CET 2011


thanks to your answers.

Am 28.11.2011 09:19, schrieb Jonathan Kew:

> Assuming the OP is interested in "native" truetype/opentype fonts, not .tfm-based fonts, \XeTeXcharglyph is the simple answer.
> JK

As I normally use (Linux Libertine O or TeX Gyre Pagella), Linux 
Biolinum O and Asana Math, I'm interested i "native" opentype fonts.

\XeTeXcharglyph (and Heiko's code) work in text mode. But I also print 
SI values in math mode, where it doesn't work. See the minimal example:

\setmainfont{DejaVu Serif}
\setmathfont{XITS Math}



\foreach \phont in {TeX Gyre Pagella, Linux Libertine O, DejaVu Serif}

\foreach \phont in {Asana Math, XITS Math, STIXGeneral, Neo Euler}


Although u2103 (why did Heiko use u018e=latin capital reversed E?) is 
only available in Asana Math (which on the other hand doesn't have °) 
the innermost \if yields true (can be seen by printing the 8 and setting 
math-celsius to a not-defined glyph).

Another problem (but that might be due to siunitx): the following 
\SI{456}{\celsius} doesn't know about the \sisetup in the math before. I 
assume this has something to do with grouping and local/global changes. 
But how can I check for glyph availability in math fonts whithout going 
into math mode via \(\)?



More information about the XeTeX mailing list