I’m extending the MATH Plugin to read MATH table and import it into the data the plugin uses (some stored in master and glyph userData, others as anchors).
I already have a callback for DOCUMENTOPENED, so I open the font there using GSDocument.filePath and import the data into the GSFont.
All is good but I have some questions/issues:
Is this the right approach or there is a better way?
The causes the font and the affected glyphs to be Edited, but since everything is imported and the user didn’t manually change anything, I want to avoid this. Is there is away to revert the edited status of the font and the glyphs?
from AppKit import NSChangeCleared
for g in font.glyphs:
g.undoManager().removeAllActions()
g.updateChangeCount_(NSChangeCleared)
font.undoManager().removeAllActions()
font.parent.updateChangeCount_(NSChangeCleared)
Another question. If I’m opening a font collection file, Glyphs will ask the user to select a font from the collection. How do I know which font was selected to open it as well?