Skip to content

fontlabapp.fontui.tglyph.TGlyph · declarations 001

Back to fontlabapp.fontui.tglyph.TGlyph

__init__

__init__(font: Any, name: str | None = None, layer: str | None = None, parent: Any = None, *, controls: bool = True, label_prefix: str = 'TGlyph', hint_check: Any = None, host: Host | None = None, read_only: bool = False)

controls=False hides the toolbar and help for embedding in a studio shell.

read_only=True keeps selection, navigation and zoom but refuses all writes. label_prefix starts every Undo name. hint_check(glyph, layer) returns a fontui.hinting.HintState; on a hinted layer point edits are refused and the status line says why.

choose_layer

choose_layer() -> None

Layer selector changed: show the same glyph on the chosen layer.

choose_name

choose_name() -> None

Glyph name field confirmed: show that glyph.

close

close() -> None

Stop following, drop the font, then disconnect everything owned.

commit

commit(edit: Edit | None) -> None

Write edit once; on success record the echo, on failure show why and revert.

fail

fail(error: Exception) -> None

Show error in the status line; the window stays usable.

fit

fit() -> None

Fit the advance box and outline into the canvas.

follow

follow() -> None

Follow callback: refresh unless the font still shows our own last write.

follow_current

follow_current() -> None

Switch to FontLab's current glyph when it is in this font and differs.

highlight

highlight(*, points: Any = (), segments: Any = (), anchors: Any = ()) -> None

Mark points/segments ((contour, index) keys) and anchors (names).

hint_state

hint_state() -> Any

The hint state of the shown glyph on its layer (None without a checker or glyph).

key_press

key_press(key: Any, modifiers: Any = 0, auto_repeat: bool = False) -> bool

Canvas keys: +/- zoom, 0 fits, space arms panning; never raise.

key_release

key_release(key: Any, auto_repeat: bool = False) -> bool

load

load(name: str | None, layer: str | None = None) -> None

Show name (on layer when given), fitted, with no selection.

move

move(x: float, y: float) -> None

Mouse move: pan, preview a point drag (no write) or grow the rubber band.

press

press(x: float, y: float, button: Any, modifiers: Any = 0) -> None

Mouse press: middle or space+left pans; left selects, drags or adds a pen point.

refresh

refresh() -> None

Re-read the shown glyph; keep zoom/pan, and the selection while the structure holds.

release

release(x: float | None = None, y: float | None = None) -> None

Mouse release: end a pan, a rubber band, or a drag (one write when it moved).

set_follow

set_follow(on: bool) -> None

Start or stop following FontLab's current glyph.

set_overlay

set_overlay(data: Any) -> None

Draw data (a GlyphData) as a ghost outline behind the glyph; None clears it.

set_tool

set_tool(tool: str) -> None

Switch between the "select" and "pen" tools.

step

step(offset: int) -> None

Show the glyph offset places away in the glyph order (Prev/Next).

wheel

wheel(delta: float, x: float, y: float) -> None

Wheel delta (eighths of a degree; 120 per notch) zooms about the cursor.

zoom

zoom(factor: float, x: float | None = None, y: float | None = None) -> None

Zoom by factor about canvas pixel (x, y) (default: the centre).