Skip to content

fontlab_fontport.pens

pens

Glyph-level adapter over fontlab_pens.fontgate.

Fontport's native model is an fgGlyph whose outline lives on glyph.layer, with glyph-level components. Pens target layers and elements only, so this module resolves the glyph itself: contours are validated, then written by fontlab_pens.fontgate.FontGatePointPen into the layer's first element (point names and smooth flags kept); components stay on glyph.components. Empty native contours are never passed to fgContour.drawPoints, whose implementation dereferences the first node without checking its existence.

The target kind is stated to pens (kind=), not detected from the native type name, so the same code serves FontGate objects and the duck-typed offline doubles. Only public fontlab_pens names are used.

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
draw_points function (glyph: Any, pen: AbstractPointPen) -> None Read native points without invoking unsafe native empty-contour code.
edit_geometry_ready function (glyph: Any) -> bool Provisional point edits stay in Python until their pen geometry is valid.