How do I extract the list of supported Unicode characters from a TrueType or embedded OpenType font on Linux?
Is there a tool or a library I can use to process a .tt
If you want to get all characters supported by a font, you may use the following (based on Janus's answer)
from fontTools.ttLib import TTFont
def get_font_characters(font_path):
with TTFont(font_path) as font:
characters = {chr(y[0]) for x in font["cmap"].tables for y in x.cmap.items()}
return characters