python - How can one find the Unicode codepoints that a font has glyphs for, on a Debian-based system? -
from scripting language (python or ruby, say) on debian-based system, find either 1 of:
- all unicode codepoints particular font has glyphs for
- all fonts have glyphs particular unicode codepoint
(obviously either 1 or 2 can derived form other, whatever easier great.) have done in past running:
fc-list : file charset
... , parsing output @ end of each line, based on this code fontconfig seems me there ought simpler way of doing this.
(i'm not sure right stackexchange site question, looking answer can used programmatically.)
i try of freetype 2 language bindings. here's perl solution list unicode code points of font using font::freetype
:
use font::freetype; font::freetype->new->face('dejavusans.ttf')->foreach_char(sub { printf("%04x\n", $_->char_code); });
Comments
Post a Comment