[XeTeX] Finding out if a font supports a particular Unicode character and using it

François Charette firmicus at ankabut.net
Thu Feb 4 13:12:37 CET 2010

Hello all,

Sorry to chime in so late in the discussion, but I just realized I've 
written a similar tool some time ago, in Perl. It does not rely on 
fontforge, but it is based on the CPAN module Font::TTF (which also 
works with OTF) by Martin Hosken of SIL. It does not perform indexing, 
but it is nevertheless quite fast, even with a relatively large 
collection of fonts. It should also work on all platforms, including 

Here is a sample output on my Linux system:

$ time fontcheck.pl 2605
Looking in 409 system fonts ...
The glyph ★ (0x2605) is available in the following fonts:
Bitstream Cyberbit Roman
DejaVu Sans Bold
DejaVu Sans Bold Oblique
DejaVu Sans Book
DejaVu Sans Condensed Bold
DejaVu Sans Condensed Bold Oblique
DejaVu Sans Condensed Book
DejaVu Sans Condensed Oblique
DejaVu Sans Mono Bold
DejaVu Sans Mono Book
DejaVu Sans Oblique
FreeMono Medium
FreeSerif Bold
FreeSerif Medium
Linux Biolinum Bold
Linux Biolinum O Bold
Linux Biolinum O Regular
Linux Biolinum Regular
Linux Libertine Bold
Linux Libertine Bold Italic
Linux Libertine C Regular
Linux Libertine Italic
Linux Libertine O Bold
Linux Libertine O Bold Italic
Linux Libertine O C Regular
Linux Libertine O Italic
Linux Libertine O Regular
Linux Libertine Regular
Lucida Sans Regular
TITUS Cyberbit Basic Regular

real 0m2.470s
user 0m2.390s
sys 0m0.073s

I've attached the script, in case someone is interested in using or 
modifying it. Note that you may have to change the paths where fonts are 
located on your system. Currently these are set to /usr/share/fonts and 
$HOME/.fonts (lines 38-39).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: glyphlookup.pl
Type: application/x-perl
Size: 2108 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20100204/39273062/attachment.bin>

More information about the XeTeX mailing list