I'm trying to write a script that checks the compatibility of glyphs before generating a MM font.
I wrote this which works for single glyphs
========================
from robofab.world import OpenFont
lightFont = OpenFont(None)
boldFont = OpenFont(None)
#
#
print lightFont.info.fullName,"/",boldFont.info.fullName
print lightFont["A"].isCompatible(boldFont["A"], True)
========================
I really wanted to do it with a loop, and loop through the whole font.
I tired this, but it gives me a list saying all the glyphs are compatible but I know they are not.
========================
from robofab.world import OpenFont
lightFont = OpenFont(None)
boldFont = OpenFont(None)
#
#
print lightFont.info.fullName,"/",boldFont.info.fullName
for glyph in lightFont:
print lightFont["glyph"].isCompatible(boldFont["glyph"], True)
print lightFont["B"].isCompatible(boldFont["B"], True)
========================
I changed the outline of the "B" and tested the compatibility after the loop and it tells me they are not compatible but the loops tells me they are
How can I loop through both fonts and test there compatibility ?