Skip to content

Instantly share code, notes, and snippets.

@connordavenport
Last active June 17, 2025 14:49
Show Gist options
  • Save connordavenport/e9469d0870e64903591045bec63f88ec to your computer and use it in GitHub Desktop.
Save connordavenport/e9469d0870e64903591045bec63f88ec to your computer and use it in GitHub Desktop.
import more_itertools
def _as_list(item):
return list(more_itertools.always_iterable(item))
def _get_designspaces(self) -> list[str]:
return _as_list(self.lib.get('public.designspaces', []))
def _set_designspaces(self, new_designspace:str | list[str]):
self.lib['public.designspaces'] = _as_list(new_designspaces)
_designspaces = property(_get_designspaces, _set_designspaces)
from mojo.roboFont import RFont
RFont.designspaces = _designspaces
RFont.designspace = _designspaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment