Skip to content

fontlabapp.fontui.tmetrics

tmetrics

TMetrics: a shaping, metrics and kerning window that follows and edits FontLab.

What: type text (or /names), features, direction, script and language; the canvas shows the shaped rows with the baseline and vertical metric lines, glyph boxes, sidebearing marks, kerning offsets and the selected glyph. The readout names the selected glyph's advance, LSB and RSB and the kerning pair before it (group or glyph pair). Click or press the arrow keys to select; double-click calls on_open_glyph(name). The LSB, RSB, Width and Kerning fields write the selected glyph and the pair before it back to the font (press Return); Alt+Left/Right nudge the RSB and Ctrl+Alt+Left/Right the pair kerning (on macOS either Control or Command with Option; see HELP_TEXT). A write to a group pair names the actual group keys in the status line. Each glyph write is one font.edit_glyph on the default layer named TMetrics: <LSB|RSB|width> <glyph>; each kerning write is one font.kerning.apply named TMetrics: kerning <left> <right>, read back. FontLab edits (outlines, metrics, kerning, features) and Undo/Redo re-shape within the follow delay, keeping the text, the selection and the scroll position; the window's own writes are recognised by fontlabapp.fontui.livesync.Echo and do not reset it a second time. Use: show_tmetrics() over the current FontLab font (double-click opens fontlabapp.fontui.tglyph on that glyph, reusing one TGlyph window), or TMetrics(font, parent, on_open_glyph) over any FontParts-style font. Why: all layout and readout rules live in the Qt-free fontlabapp.fontui.tmetrics_model; 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
BEARING_TICK attribute
COLORS attribute
DIRECTION_LABELS attribute
HELP_TEXT attribute
KEY_STEPS attribute
NO_FONT_MESSAGE attribute
NO_PAIR_MESSAGE attribute
NUDGE_KEYS attribute
READ_ONLY_MESSAGE attribute
SHIFT_FACTOR attribute
TITLE attribute
create_canvas function (owner: TMetrics, parent: Any) -> Any Return the TMetrics canvas widget; it paints and forwards input to <code>owner</code>.
open_tglyph function (window: TMetrics, name: str) -> Any Show <code>name</code><code> of </code><code>window.font</code> in TGlyph, reusing the window's open TGlyph.
paint function (owner: TMetrics, canvas: Any) -> None Paint guides, boxes, bearings, kerning, selection and outlines; never raise.
show_tmetrics function (font: Any=None, text: str | None=None, *, parent: Any=None, on_open_glyph: Any=None) -> TMetrics | None Open TMetrics over <code>font</code> (default: FontLab's current font) and return it.