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

Jonathan Kew jfkthame at googlemail.com
Mon Nov 28 08:19:48 CET 2011


On 28 Nov 2011, at 06:59, Heiko Oberdiek wrote:

> On Mon, Nov 28, 2011 at 03:07:07PM +1030, Andrew Moschou wrote:
> 
>> 2011/11/28 Zdenek Wagner <zdenek.wagner at gmail.com>
>> 
>>> Put it into an \hbox and measure its width (\wd). If the width is
>>> zero, the glyph does not exist.
>>> 
>> 
>> If the required glyph doesn't exist, wouldn't this measure the ".notdef"
>> glyph?
> 
> No,

Yes, it would (and .notdef may of course have non-zero width).

> the problem is rather that a existing glyph can have width zero
> (not likely in your case) and that there is a warning in the .log file.
> See my examples.

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

JK




More information about the XeTeX mailing list