compare point placement

Mike Duggan
Posts: 239
hi, anyone know of a tool to compare and diff point placement between two ttf files?
0
Comments
-
fontdiffenator has a visual comparison; not exactly what you have in mind, I suppose, but still useful. I suppose you could ttx/ufo the files, or use fonttools directly, diff the parsed output.Compare the first contour of /A in old.ttf to new.ttf:from fontTools.ttLib import TTFontExpand for all glyphs, composite glyphs and all contours, and play with difflib to get the output you want.
from difflib import ndiff
old = TTFont("old.ttf")
new = TTFont("new.ttf")
old_A = old["glyf"]["A"].getCoordinates(old["glyf"])
new_A = old["glyf"]["A"].getCoordinates(new["glyf"])
print("\n".join(ndiff(
[str(p) for p in old_A[0]],
[str(p) for p in new_A[0]])))
1 -
Thank you Johannes!0
Categories
- All Categories
- 43 Introductions
- 3.7K Typeface Design
- 815 Font Technology
- 1.1K Technique and Theory
- 630 Type Business
- 450 Type Design Critiques
- 548 Type Design Software
- 30 Punchcutting
- 137 Lettering and Calligraphy
- 84 Technique and Theory
- 53 Lettering Critiques
- 497 Typography
- 307 History of Typography
- 116 Education
- 74 Resources
- 510 Announcements
- 82 Events
- 107 Job Postings
- 154 Type Releases
- 166 Miscellaneous News
- 271 About TypeDrawers
- 53 TypeDrawers Announcements
- 117 Suggestions and Bug Reports