Skip to content

fontlab_pens.base

base

Segment-pen protocol: abstract pens, BasePen and segment decomposition.

A pen standardises how outlines are drawn: outline.draw(pen) makes the outline call moveTo, lineTo, curveTo, qCurveTo, closePath/endPath and addComponent on the pen. This module is a dependency-free port of the fontTools module so FontLab code can speak the protocol without fontTools. BasePen subclasses override _moveTo, _lineTo, _curveToOne (and optionally _qCurveToOne, _closePath, _endPath); it splits super-beziers and TrueType quadratic strings, including the off-curve-only None form.

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
Point attribute
TransformLike attribute
decomposeQuadraticSegment function (points: Sequence[Point]) -> list[tuple[Point, Point]] Split a TrueType quadratic string into (offCurve, onCurve) segments.
decomposeSuperBezierSegment function (points: Sequence[Point]) -> list[tuple[Point, Point, Point]] Split a super-bezier (2+ off-curves, then the on-curve) into cubic segments.