Skip to content

Instantly share code, notes, and snippets.

@connordavenport
Last active October 21, 2025 18:30
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
@ryanbugden
Copy link

@connordavenport Maybe RFont.designspace should get either the first in the list, or None if the list if empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment