Skip to content

Instantly share code, notes, and snippets.

@connordavenport
Created February 21, 2025 21:28
Show Gist options
  • Save connordavenport/ca5505e1c85acb02c45e0326a2927e1f to your computer and use it in GitHub Desktop.
Save connordavenport/ca5505e1c85acb02c45e0326a2927e1f to your computer and use it in GitHub Desktop.
RGlyph getter/setter for skip export
from mojo.roboFont import RGlyph
def _setExport(self, export):
skipExportGlyphs = set(self.font.lib.get("public.skipExportGlyphs", []))
if export == False:
skipExportGlyphs.add(self.name)
elif export == True:
if self.name in skipExportGlyphs:
skipExportGlyphs.remove(self.name)
else:
raise TypeError("export status must be a boolean, not %s."
% type(locked).__name__
)
self.font.lib["public.skipExportGlyphs"] = list(sorted(skipExportGlyphs))
self.font.lib.changed()
def _getExport(self):
return self.name not in self.font.lib.get("public.skipExportGlyphs", ())
export = property(_getExport, _setExport)
RGlyph.export = export
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment