Skip to content

fontlabapp.fontui.tglyph_edit.Editor · declarations 001

Back to fontlabapp.fontui.tglyph_edit.Editor

__init__

__init__(model: TGlyphModel, label_prefix: str = 'TGlyph', *, read_only: bool = False) -> None

busy property

busy: bool

True while a drag or a rubber band is in progress.

cancel

cancel() -> None

Cancel a drag or rubber band; a drag preview reverts to before.

commit

commit(edit: Edit) -> str

Write edit once; return the fingerprint of the drawn state for Echo.

On failure the glyph shown before the edit is restored (pen state ends) and the error propagates for the window's diagnostic line.

delete

delete() -> Edit | None

Delete the selected points; None without a selection. The selection clears.

escape

escape() -> bool

Escape: cancel the gesture or end the pen contour; True when something ended.

move

move(sx: float, sy: float) -> None

Pointer moved: preview a drag (no write) or grow the rubber band.

nudge

nudge(dx: float, dy: float) -> Edit | None

Shift the selection by (dx, dy) font units; None without a selection.

pen_click

pen_click(sx: float, sy: float) -> Edit | None

Pen click: start, extend or close an open contour.

The first click of a contour only sets pending and returns None, so nothing is written; the second click (away from the pending point) returns the two-point open contour. Later clicks add a point, or close the contour on its first point.

press

press(sx: float, sy: float, extend: bool = False) -> None

Select-tool press: drag a hit selection, select a hit point, or start a band.

release

release(sx: float | None = None, sy: float | None = None) -> Edit | None

End the gesture; a drag that moved returns its Move edit, else None.

reset

reset() -> None

Cancel the gesture (reverting a preview), end the pen contour and drop a pending point.

set_tool

set_tool(tool: str) -> None

Switch to "select" or "pen"; any gesture and pen contour end.

toggle

toggle() -> Edit | None

Toggle selected on/off-curve roles; refuse invalid open endpoints.