compare point placement
Mike Duggan
Posts: 248
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
- 47 Introductions
- 4K Typeface Design
- 496 Type Design Critiques
- 589 Type Design Software
- 1.1K Type Design Technique & Theory
- 674 Type Business
- 902 Font Technology
- 29 Punchcutting
- 543 Typography
- 128 Type Education
- 333 Type History
- 82 Type Resources
- 114 Lettering and Calligraphy
- 33 Lettering Critiques
- 81 Lettering Technique & Theory
- 577 Announcements
- 101 Events
- 116 Job Postings
- 174 Type Releases
- 185 Miscellaneous News
- 270 About TypeDrawers
- 54 TypeDrawers Announcements
- 114 Suggestions and Bug Reports
