Created
June 10, 2016 22:36
-
-
Save miguelsousa/a67497ab2c9dbd11d8e9bb98b16a0a2f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| from fontTools import ttLib | |
| from fontTools.pens.areaPen import AreaPen | |
| fontFileName = "areatestfont.otf" | |
| gNamesList = "testA testB testC testD".split() | |
| ttFont = ttLib.TTFont(fontFileName) | |
| gSet = ttFont.getGlyphSet() | |
| for gName in gNamesList: | |
| g = gSet[gName] | |
| aPen = AreaPen(g) | |
| g.draw(aPen) | |
| area = aPen.value | |
| print area |
Author
Right. Seems to be an issue with CFF fonts, but TrueType. Fixed in symfont. I'll let Cosimo finish up areaPen and merge.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The OTF can be found at http://cl.ly/gQBe/download/areatestfont.otf.zip