Created
February 21, 2025 21:28
-
-
Save connordavenport/ca5505e1c85acb02c45e0326a2927e1f to your computer and use it in GitHub Desktop.
RGlyph getter/setter for skip export
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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