Skip to content

fontlab_glyport.drawing.context · declarations 001

Back to fontlab_glyport.drawing.context

current

current() -> GraphicsContext

The active context; outside a scope there is none (RuntimeError).

optional_current

optional_current() -> GraphicsContext | None

A nil Cocoa context: geometry works, painting has no destination.

paint_scope

paint_scope(qt: Any)

Factory for PluginEnv.paint_scope: glyph units -> widget pixels.

reporter_view_scope

reporter_view_scope(scale: float)

View hooks use the widget bounds in Cocoa points, independent of glyph origin.

scope

scope(qt: Any, painter: Any, base: Affine, *, flipped: bool = False) -> Iterator[GraphicsContext]

Make a context current around painter (saved and restored).

view_scope

view_scope(qt: Any, painter: Any, height: float, *, flipped: bool)

NSView.drawRect_: y-up bounds unless the view is flipped.