I need to automate a process of verification which Unicode characters have actual glyphs defined for them in a True Type Font file. How do I go around doing that? I can't seem to find information on how to make sense of the numbers I seem to be getting when I open a .ttf file in a text editor.
|
I found a python library, fonttools (pypi) that can be used to do it with a bit of python scripting. Here is a simple script that lists all fonts that have specified glyph:
First argument is codepoint (decimal or hexa with 0x) and the rest is font files to look in. I didn't bother trying to make it work for Note: I first tried the otfinfo tool, but I only got basic multilingual plane characters (<= U+FFFF). The python script finds extended plane characters OK. |
|||
|
|
|
otfinfo looks promising:
For example DejaVuSans-Bold knows about the fl ligature(fl):
|
|||||||||||||||||||||
|