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
- 800 Font Technology
- 1K Technique and Theory
- 617 Type Business
- 444 Type Design Critiques
- 541 Type Design Software
- 30 Punchcutting
- 136 Lettering and Calligraphy
- 83 Technique and Theory
- 53 Lettering Critiques
- 483 Typography
- 301 History of Typography
- 114 Education
- 68 Resources
- 498 Announcements
- 79 Events
- 105 Job Postings
- 148 Type Releases
- 165 Miscellaneous News
- 269 About TypeDrawers
- 53 TypeDrawers Announcements
- 116 Suggestions and Bug Reports