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
- 811 Font Technology
- 1.1K Technique and Theory
- 628 Type Business
- 449 Type Design Critiques
- 547 Type Design Software
- 30 Punchcutting
- 137 Lettering and Calligraphy
- 84 Technique and Theory
- 53 Lettering Critiques
- 493 Typography
- 307 History of Typography
- 115 Education
- 71 Resources
- 505 Announcements
- 81 Events
- 106 Job Postings
- 151 Type Releases
- 166 Miscellaneous News
- 271 About TypeDrawers
- 53 TypeDrawers Announcements
- 117 Suggestions and Bug Reports