fontlabapp.vfjo.nodes.Node
Node
dataclass
One contour node: points, flags and optional attribute text.
flags holds unknown extra tokens in their original order; attrs
is the raw {...} text. Known flags format in the order s, o, g2, c,
then unknown tokens.
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 |
|---|---|---|---|
__str__ |
attribute | ||
attrs |
attribute | str | None |
|
close |
attribute | bool |
|
flags |
attribute | tuple[str, ...] |
|
format |
function | (self) -> str |
Return the node string (exact for an unmodified parsed node). |
g2 |
attribute | bool |
|
mapped |
function | (self, fn: Callable[[Number, Number], Point]) -> Node |
Return a new node with every point replaced by <code>fn(x, y)</code>. |
moved |
function | (self, dx: Number, dy: Number) -> Node |
Return a new node translated by <code>(dx, dy)</code>. |
name |
attribute | (self) -> str | None |
The node name from <code>n:'...'</code> in the attributes, else None. |
offcurve |
attribute | bool |
|
offcurves |
attribute | (self) -> list[Point] |
The off-curve points: all for close/<code>o</code> nodes, else all but the last. |
on |
attribute | (self) -> Point | None |
The on-curve point; None for a closing node or a TrueType off-curve. |
parse |
function | (cls, text: str) -> Node |
Parse a node string; raise ValueError (with the text) if malformed. |
points |
attribute | tuple[Point, ...] |
(shared captured text) |
scaled |
function | (self, sx: Number, sy: Number | None=None, origin: Point=(0, 0)) -> Node |
Return a new node scaled by <code>sx</code><code>/</code><code>sy</code><code> (default </code><code>sx</code><code>) around </code><code>origin</code>. |
smooth |
attribute | bool |
(shared captured text) |