API

Work in progress

Geometry

drafting.geometry.Point(*points)

Representation of a point (x,y), indexable

drafting.geometry.Line(start, end)

drafting.geometry.Curve(start, cp1, cp2, end)

drafting.geometry.Rect(*rect)

Representation of a rectangle as (x, y, w, h), indexable

Textsetting Classes

drafting.text.reader.Style(font, …[, …])

Class for configuring font properties

drafting.text.reader.StyledString(text, style)

Lowest-level vectorized typesetting class

drafting.text.composer.Composer(rect, text, …)

For multiline text lockups

drafting.text.richtext.RichText(rect, text, …)

Very experimental module to support rich-text from annotated strings, like a super-minimal-but-open-ended subset of markdown, inspired by the way rich text is built up in the time.nle.premiere DPS subclass in coldtype

The most important thing to understand is that textsetting classes can be turned into vector classes via the .pen or .pens methods available on both StyledString and Composer — .pen gets you a single vector representation of a piece of text (aka a DATPen), while .pens gets you a structured list of DATPen’s, aka a DATPens.

Vector/Path Classes

drafting.pens.draftingpen.DraftingPen(*args)

Fluent subclass of RecordingPen

drafting.pens.draftingpens.DraftingPens([pens])