fonttools/Scripts/RoboFabIntro/demo_FindCompatibleGlyphs.py
Erik van Blokland 617945dcf1 The scripts folder for FontLab as they shipped with Fab 1.1.1.
git-svn-id: http://svn.robofab.com/trunk@22 b5fa9d6c-a76f-4ffd-b3cb-f825fc41095c
2008-01-16 08:14:00 +00:00

27 lines
571 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.fullName)
for d, names in compatibles.items():
if len(names) > 1:
print ", ".join(names)