FontParts ↩
FontParts is an application-independent font object API for creating and editing fonts.
RoboFont implements the FontParts object model and adds some methods and attributes of its own.
Font objects out-of-the-box
When writing code in the Scripting Window, objects from the fontParts.world module are available out-of-the-box – so you can use CurrentFont
, CurrentGlyph
, AllFonts
etc. directly, without having to import them at the top of your scripts.
The main font object classes – RFont
, RGlyph
, RContour
etc. – are also available.
Font objects in imported modules
To use font objects in external modules, it is necessary to import them from mojo.roboFont
first:
# myModule.py
from mojo.roboFont import CurrentFont
def getFont():
return CurrentFont()