Python in Counterpunch

Counterpunch includes an embedded Python runtime (Pyodide) so you can automate font work without switching tools or exporting intermediate data. Scripts see the currently open font. You can test an idea, inspect the result, and iterate in the same session as the outlines.

The Python environment is good for repeating edits consistently, automating cleanup, and querying the font model. The runtime stays in the browser. Konsole is for immediate exploration. Scripts is for code you intend to reuse. Overview filters are a separate kind of file; they only classify glyphs.

These helpers are already in scope and do not need to be imported:

font = Font()      # open font; raises if none is open
glyph = Glyph()    # glyph being edited in outline mode
layer = Layer()    # layer being edited in outline mode
master = Master()  # selected master, or None off a stored master

Glyph() and Layer() raise when outline editing is inactive. Master() uses the active layer in outline mode, or the selected master in text mode.

Scripts view next to Konsole

The object model is documented in Python API. Start writing in Script editor. Quick commands are in Konsole.