Skip to content

Instantly share code, notes, and snippets.

@lucasdinonolte
Created July 29, 2016 22:07
Show Gist options
  • Save lucasdinonolte/cdd0d153d668e2367f77a62b4c103fdd to your computer and use it in GitHub Desktop.
Save lucasdinonolte/cdd0d153d668e2367f77a62b4c103fdd to your computer and use it in GitHub Desktop.
# type your Python code here and press cmd+Return to run.
reference = "n"
glyph = Glyphs.font.glyphs[reference].layers[0]
referenceWidth = glyph.width - glyph.LSB - glyph.RSB
print "Reference:", reference, referenceWidth
for char in ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]:
curGlyph = Glyphs.font.glyphs[char].layers[0]
width = curGlyph.width - curGlyph.LSB - curGlyph.RSB
print char, width / referenceWidth * 100, "%"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment