Skip to content

fontlab_glyport.model.fontlab_backend.FontLabBackend · declarations 001

Back to fontlab_glyport.model.fontlab_backend.FontLabBackend

__init__

__init__(packages: Iterable[object] | None = None)

add_anchor

add_anchor(layer_id: str, anchor: AnchorInfo) -> str

add_axis

add_axis(font_id: str, axis: AxisInfo) -> str

Native fact (glyport-r020/probe-axes-instances-run1): flAxis(name, tag, short name) and addAxis; masters read the default coordinate until set.

add_hint

add_hint(layer_id: str, hint: HintInfo) -> None

add_instance

add_instance(font_id: str, instance: InstanceInfo) -> None

anchor_selected

anchor_selected(anchor_id)

append_component

append_component(layer_id: str, component: ComponentInfo) -> str

FontLab 9.0.9780 offers no working component constructor from Python (flLayer.setGlyphComponents rejects every argument form; addComponent only records a recipe entry). A component is built by fontpr set_glyph in a scratch glyph, cloned into the layer, and the scratch glyph is deleted (probe_create_glyph.json). Translation transforms only.

append_glyph

append_glyph(font_id: str, name: str, *, unicodes: tuple[str, ...] = ()) -> str

Construct inside the target package from a value-only VFJ recipe.

flPackage.addGlyph(flGlyph) transfers an FG pointer rather than copying it. Use the same target-owned builder as fontport, including for replace.

append_guide

append_guide(layer_id: str, guide: GuideInfo) -> str

append_layer

append_layer(glyph_id, master_id, name, snapshot)

append_master_guide

append_master_guide(master_id, guide)

append_path

append_path(layer_id: str, path: PathInfo) -> str

background_layer

background_layer(layer_id)

begin_undo

begin_undo(name: str) -> None

cache_revision

cache_revision(font_id, key)

Validate glyph-owned snapshots against notified native edits and Undo.

Parent traversal is bounded by object depth, independent of font size. Native writes without history notification have no observable marker.

can_publish_undo

can_publish_undo(font_id: str) -> bool

Check package registration before dereferencing any stored children.

An explicitly scoped package can remain isValid after leaving the workspace. Closed/unregistered packages must never reach flItems.

classes

classes(font_id: str) -> tuple[ClassInfo, ...]

clear_background_layer

clear_background_layer(layer_id)

close_font

close_font(font_id: str, *, ignore_changes=False) -> None

Close a document, requiring deliberate permission to discard edits.

component_bounds

component_bounds(component_id)

component_selected

component_selected(component_id)

current_font_id

current_font_id() -> str | None

current_layers

current_layers(font_id: str) -> tuple[tuple[str, str], ...]

current_master

current_master(font_id: str) -> str | None

dark_mode

dark_mode()

decompose_component

decompose_component(layer_id: str, component_id: str, *, on_detach: Callable[[], None]) -> None

discard_undo

discard_undo() -> None

Drop pending wrappers locally; do not call any native API.

edit_view

edit_view(font_id: str) -> EditViewInfo | None

end_undo

end_undo() -> None

features

features(font_id: str) -> FeaturesInfo

font_id_for

font_id_for(package) -> str | None

Font id of a native package (e.g. a signal argument) in this scope.

font_info

font_info(font_id: str) -> FontInfo

font_path

font_path(font_id: str) -> str | None

flPackage.fileName (echopy fontlab.pyi); unsaved fonts have no path.

glyph_info

glyph_info(glyph_id)

Read one glyph's metadata without listing the font.

glyph_last_change

glyph_last_change(glyph_id: str) -> str | None

flGlyph.lastModified (QDateTime) as local YYYY-MM-DD HH:MM:SS.

glyph_layers

glyph_layers(glyph_id)

Master order first, followed by ordinary auxiliaries in native order.

Keep explicit copied associations across live peers/history. Imported auxiliaries without session metadata use the first-master fallback; no persistent native lib keys are invented for this mapping.

glyph_lookup

glyph_lookup(font_id, key, *, unicode=False)

Consult FontGate's authoritative name/Unicode hash maps.

flPackage delegates both finders to fg::Font (font.cpp:2384/2435). This observes other glyphs' renames without scanning their markers. Older/incomplete hosts without a finder use the bounded index fallback.

glyph_note

glyph_note(glyph_id: str) -> str

glyph_selected

glyph_selected(font_id, glyph_id)

glyph_tags

glyph_tags(glyph_id: str) -> tuple[str, ...]