Skip to content

fontlabapp.guides.inspect.model · declarations 001

Back to fontlabapp.guides.inspect.model

GLYPH_GUIDE module-attribute

GLYPH_GUIDE

HORIZONTAL

HORIZONTAL

TITLE module-attribute

TITLE

VECTOR

VECTOR

VERTICAL

VERTICAL

add_guides

add_guides(package: Any, jobs: list[tuple[Any, Any, list]], title: str = TITLE) -> dict[str, int]

Preflight and construct all guides before the original single Undo step.

Callers provide freshly checked native layers from the bound font. Empty jobs do nothing. Refuse auto layers and auto dependants before notification; construct every native guide before the first layer is changed. Initialize object history directly to avoid an empty Undo entry, and stamp only the edited glyphs in UTC before the final history snapshot so Redo restores it.

affected_auto_layers

affected_auto_layers(records: tuple[tuple[str, bool, tuple[str, ...]], ...], targets: set[str]) -> list[str]

Find automatic dependants, including chains through manual composites.

Combine master records conservatively by glyph name: the measured history defect changes glyph dates, which are shared across layers. Walk a finite set so circular references do not hang FontLab's UI thread.

dependency_values

dependency_values(package: Any) -> tuple[tuple[str, bool, tuple[str, ...]], ...]

Read resolved components and auto roles from every registered glyph layer.

Missing glyphs abort the complete read. Font order comes from this package's own FontGate font (package.fgPackage.glyphs), not from the active font, so a non-active package is read correctly (Issue 250). Never convert a native flGlyph through its unsafe fgGlyph getter.

glyph_guides

glyph_guides(layer: Any) -> list[Any]

grid

grid(direction: int, origin: float, step: float, count: int) -> list[tuple[float, float, float, str]]

Guide records (x, y, angle, name) of the grid; pure, no font access.

guide_record

guide_record(guide: Any) -> tuple[float, float, float, str]

(x, y, angle in degrees, name) of an flGuideLine; x is 0 for horizontal, y for vertical guides.

new_guide

new_guide(values: tuple[float, float, float, str]) -> Any

A glyph guide through (x, y) at angle degrees (0 horizontal, 90 vertical).

require_safe_targets

require_safe_targets(package: Any, targets: set[str]) -> None

Refuse the entire edit before history when native Undo cannot restore it.