Skip to content

fontlab_glyport.plugins.fontlab_host.FontLabPluginHost · declarations 001

Back to fontlab_glyport.plugins.fontlab_host.FontLabPluginHost

__init__

__init__(qt: Any, fontlab: Any, *, error_sink: Callable[[Exception, object], object], painters: Any = None, model: Any = None, main_window: Any = None)

current_font

current_font()

has_callbacks property

has_callbacks: bool

main_window

main_window() -> Any

FontLab's main window; a missing one raises HostUnavailable.

Only App's qtsafe.MainWindowNotFound means "no window". A plain RuntimeError (the off-GUI-thread refusal) propagates, whatever its text says.

notify

notify(title: str, message: str) -> None

redraw

redraw() -> None

register_file_format

register_file_format(file_format: Any, *, guard: Callable | None = None) -> int

File > "Export with <title>…"; guard(owner, function, *args) (PluginEnv.guard) runs the plugin's export in its context.

register_menu

register_menu(menu: str, item: Any, index: int | None = None) -> int

Add item as an owned QAction in menu; return its token.

Atomic: if the first sync fails (for example a bad icon), the token and its QAction are removed before the error re-raises (inside a host slot App defers that removal to the end of the dispatch).

register_painter

register_painter(phase, callback, *, document_id=None, layer_filter='active')

register_panel

register_panel(view: Any, title: str, min_height: int, max_height: int) -> int

register_tool

register_tool(tool: Any, *, guard: Callable | None = None, activate: Callable[[], Any] | None = None, deactivate: Callable[[], Any] | None = None) -> int

Add tool to FontLab's tools; activate/deactivate run when FontLab switches to and away from it (see ToolBridge).

remove

remove(token: object) -> None

Undo one item, including its NSMenuItem observer (see App remove).

reporter_background_phase property

reporter_background_phase: str

Known at load, before any painter is enabled: native canvas painters draw backgrounds before the outlines; the overlay fallback after (R054).

restore_layer

restore_layer(layer, snapshot) -> None

run_dialog

run_dialog(view: Any, title: str, apply_label: str, on_close: Callable[[bool], None]) -> int

Show view with Cancel/Apply; on_close(applied) runs once.

Apply, Cancel, the title-bar close and removing the token all end the session through App's tool-window close. A button only records the outcome and closes the window. The button connections are dropped from the shared timer, after the dispatch that ended the session and before the window is closed and deleted.

selected_layers

selected_layers()

snapshot_layer

snapshot_layer(layer)

undo_group

undo_group(name: str) -> AbstractContextManager