Skip to content

Instantly share code, notes, and snippets.

@santhoshtr
Created August 21, 2011 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save santhoshtr/1160834 to your computer and use it in GitHub Desktop.
Save santhoshtr/1160834 to your computer and use it in GitHub Desktop.
List the glyph properties of the Font
import fontforge
font = fontforge.open("/usr/share/fonts/truetype/ttf-malayalam-fonts/Meera_04.ttf", 4)
print "Glyphs"
for (i,g) in enumerate(font.glyphs()):
print "%s\t%s\t%s\t%s\t%s\t%s\t%s"%(i,g.glyphname,g.glyphclass,g.script,g.encoding,g.unicode,g.getPosSub("*"))
print "GSUB Lookups"
for (i,g) in enumerate(font.gsub_lookups):
print "%s\t%s"%(i,g)
print "GPOS Lookups"
for (i,g) in enumerate(font.gpos_lookups):
print "%s\t%s"%(i,g)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment