Skip to content

fontlabapp.plugins.backend

backend

Native per-canvas painters with an EditorPainters fallback for old builds.

FontLab's text-block item applies its own transform before drawing a glyph item (fltextblockitem.cpp). EditorPainters applies the glyph-item and block transforms in that order. This backend does the same, then uses the native canvas.mapToViewportF map for final viewport coordinates. The HT Letterspacer consumer uses the glyph transform alone; that suffices only when the block's transform is identity.

While an enabled reporter has needs_mouse, one event filter watches the active canvas viewport. A mouse or hover move starts a single-shot REPAINT_MS timer unless one is pending; its timeout calls canvas.updateScreenRect over the whole viewport (viewport pixels), then canvas.updateViewport(): the first only adds the rect to FontLab's pending update region, and only the second repaints it. Flushes are thus at most one per window and always trail the last move, and the paint reads canvas.mousePosition() after FontLab has stored it. That moves reach a viewport filter under every tool is unverified natively.

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
POLL_MS attribute (shared captured text)
REPAINT_MS attribute
active_glyph_map function (canvas: Any, items: Any=None) -> _GlyphMap | None Find the active glyph occurrence, including later text-line positions.
select_backend function (qt: Any, fontlab: Any, sink: Callable[[Exception, object], object], *, editor_factory: Any=None, items: Call… Choose native hooks once; import EditorPainters only for older builds.