mojo.smartSet

addSmartSet(smartSet, index=None, font=None)

Add a Smart Set object.

index
Optionally insert the given Smart Set at an index.
font
Optionally provide a font to store the smart set in the font.

copyNSObjects(obj)

getDefault(key, defaultValue=None, defaultClass=None)

Get a default Preferences value for a key, with a fallback value if the key is not present in the defaults.

getSmartSets(font=None)

Return a list of all current Smart Sets.

font
Optionally provide a font get the smartsets from the font.

readSmartSets(path, useAsDefault=False, font=None)

Read a roboFontSets file and optionally store as defaults with useAsDefault.

removeSmartSet(smartSetName, font=None)

Remove a Smart Set by name.

font
Optionally provide a font to remove the smart set in the font.

selectSmartSets(selection, currentDocumentOnly=True)

Select Smart Sets according to a given list of indexes.

currentDocumentOnly
Optionally apply the selection to all open documents.

selectedSmartSets()

Return a list of selected Smart Sets for the current document.

setDefault(key, value, validate=False)

Set a default Preferences value for a key.

Optionally validate the key and the value.

setSmartSets(smartSets, font=None)

Set a list of Smart Sets.

font
Optionally provide a font to store the smart set in the font.

updateAllSmartSets(selection=None)

Update the Smart Set list in the UI of all open Font Windows.

class RoboFontError()

Common base class for all non-exit exceptions.

class SmartSet()

A Smart Set object.

Inherits from subclass: mojo.smartSet.SmartSet

glyphNames

A list of glyph names.

groups

Return a list of all smart sets inside a group item.

query

Search query of the smart set.

addGroupSmartSet(smartSet)

Add a provided smartSet to a Smart Set group item.

getQueryObject()

Return the query as a NSPredicate object.

getQueryResult(font)

Return a list of glyph names after applying a query for a given font.

isGroup()

Return a bool indicating if the Smart Set is a group item.

removeGroupSmartSet(smartSet)

Remove the provided smartSet from a Smart Set group item.

removeGroups()

Remove all groups in the group item.

selected()

Return a bool if this smartSet is selected.

class SmartSetsEditor()

A Smart Set contexts manager. To be used with a with statement. A SmartSetsEditor will automatically set the changed smart sets and update all the Smart Set in the UI of all Open Font Windows.

with SmartSetsEditor() as smartSets:
    for smartSet in smartSet:
        if smartSet.selected():
            smartSet # do something
font
Optionally provide a font to store the smart set in the font.
Inherits from subclass: mojo.smartSet.SmartSetsEditor
Last edited on 08/12/2024