Created
September 20, 2016 19:33
-
-
Save m4rc1e/a0c2f20247c2c509853bb4d2a26c6baf to your computer and use it in GitHub Desktop.
Glyphsapp: Tallest and Deepest glyph in all masters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
font = Glyphs.font | |
tallest = 0 | |
tallest_name = '' | |
deepest = 0 | |
deepest_name = '' | |
for i, master in enumerate(font.masters): | |
for glyph in font.glyphs: | |
height = glyph.layers[i].bounds[-1][-1] | |
depth = glyph.layers[i].bounds[0][-1] | |
if height > tallest: | |
tallest = height | |
tallest_name = glyph.name | |
if depth < deepest: | |
deepest = depth | |
deepest_name = glyph.name | |
print 'deepest glyph is %s %s' % (deepest_name, deepest) | |
print 'tallest glyph = %s %s' % (tallest_name, tallest) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment