Skip to content

fontlabapp.fontui.tglyph

tglyph

TGlyph: a single-glyph view that follows FontLab.

What: one glyph of a font on an explicit layer (the layer selector lists the font's layers/masters and starts on the default layer). The glyph name field completes existing names; Prev/Next step through the glyph order. The canvas draws the filled outline, on-curve points (squares; circles when smooth) and off-curve points (small circles) with handle lines, a start point marker, components (drawn, not editable), named anchors, the baseline, the advance box and the vertical metric lines. Zoom with the wheel, +/- or Fit (0); pan with space-drag or a middle-button drag; click a point to select it (Shift adds or removes) or drag a rubber band. Editing: drag selected points (the handles of a moved on-curve point follow), nudge with the arrows (Shift: 10 units), Delete removes points, and the pen tool (P; V returns to select) adds line points to a new open contour, closes it on its first point and ends with Escape. Each gesture writes once, on release or on the key, through fontlabapp.fontui.tglyph_edit.Editor to the shown layer only; a drag only previews until release, and a failed write reverts with its reason in the status line. FontLab edits and Undo/Redo refresh within the follow delay, keeping zoom, pan and selection while the point structure stays the same. "Follow FontLab current glyph" switches to the glyph FontLab shows when it changes (names absent from this font are ignored). Refreshes go through fontlabapp.fontui.livesync.Echo so the window's own writes can be skipped. Use: show_tglyph() for FontLab's current font and glyph, or TGlyph(font, name, layer) over any FontParts-style font. Why: geometry, hit-testing and change detection live in the Qt-free fontlabapp.fontui.tglyph_model and the edits in tglyph_edit; this module only draws and forwards input.

Classes

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
COLORS attribute
DELETE_KEYS attribute
FIT_KEYS attribute
FOLLOW_LABEL attribute
FOLLOW_POLL_MS attribute
HANDLE_SIZE attribute
HELP_TEXT attribute
HIGHLIGHT_KINDS attribute
NO_FONT_MESSAGE attribute
NUDGE_KEYS attribute
NUDGE_SHIFT attribute
POINT_SIZE attribute
START_SIZE attribute
TITLE attribute
TOOL_KEYS attribute
ZOOM_KEYS attribute
create_canvas function (owner: TGlyph, parent: Any) -> Any Return the TGlyph canvas widget; it paints and forwards input to <code>owner</code>.
current_glyph_name function (font: Any) -> str | None Name of FontLab's current glyph when <code>font</code> has it; None otherwise or offline.
paint function (owner: TGlyph, canvas: Any) -> None Paint metrics, advance box, components, outline, handles, points and anchors; never raise.
show_tglyph function (font: Any=None, name: str | None=None, layer: str | None=None, *, parent: Any=None) -> TGlyph | None Open TGlyph over <code>font</code><code>&#x27;s </code><code>name</code><code> on </code><code>layer</code> and return it.