Skip to content

fontlabapp.vfjo.nodes

nodes

Node strings of FontLab 9.1 object JSON as a small, exact model.

What: a contour in the JSON is a list of node strings such as "326 994 348 983 375 983 s {n:'sv01'}". Node parses one string, exposes its points, flags and name, and formats it back byte for byte when unmodified. moved, scaled and mapped return new nodes and never change the point count (hint indexes depend on it).

Grammar (verified live on FontLab 9.1): points are x y pairs; the points of a node are separated by two spaces; then optional flags (s smooth, o TrueType off-curve, g2, c close, unknown tokens kept in order); then optional {...} attribute text kept verbatim. One point is an on-curve; three points are off, off, on; two points with c are the closing curve's off-curves.

How to use: Node.parse(s), str(node), parse_nodes(list), format_nodes(list). Used by fontlabapp.vfjo edit helpers.

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
Number attribute (shared captured text)
Point attribute
format_nodes function (nodes: list[Node]) -> list[str] Format nodes back to a contour's node strings.
format_number function (value: Number) -> str Format a coordinate: integral values as int text, else 3 decimals trimmed.
parse_nodes function (texts: list[str]) -> list[Node] Parse a contour's node strings.