fonttools/Scripts/RoboFabIntro/demo_FindCompatibleGlyphs.py
Tal Leming ea39f12120 Merged ufo2 branch r95:170 into the trunk.
git-svn-id: http://svn.robofab.com/trunk@171 b5fa9d6c-a76f-4ffd-b3cb-f825fc41095c
2009-02-28 15:47:24 +00:00

27 lines
581 B
Python

#
#
# make a list of which glyphs in this font could theoretically
# interpolate with each other.
#
#
from robofab.world import CurrentFont
from robofab.pens.digestPen import DigestPointPen, DigestPointStructurePen
compatibles = {}
f = CurrentFont()
for c in f:
p = DigestPointStructurePen()
c.drawPoints(p)
d = p.getDigest()
if not compatibles.has_key(d):
compatibles[d] = []
compatibles[d].append(c.name)
print
print 'In %s, these glyphs could interpolate:'%(f.info.postscriptFullName)
for d, names in compatibles.items():
if len(names) > 1:
print ", ".join(names)