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
- 44 Introductions
- 3.8K Typeface Design
- 825 Font Technology
- 1.1K Technique and Theory
- 637 Type Business
- 453 Type Design Critiques
- 550 Type Design Software
- 30 Punchcutting
- 139 Lettering and Calligraphy
- 86 Technique and Theory
- 53 Lettering Critiques
- 503 Typography
- 311 History of Typography
- 118 Education
- 74 Resources
- 526 Announcements
- 84 Events
- 110 Job Postings
- 162 Type Releases
- 169 Miscellaneous News
- 272 About TypeDrawers
- 54 TypeDrawers Announcements
- 117 Suggestions and Bug Reports