Skip to main content

Text

Extends ExtrudableGeometry

Inherited from Geometry

guide()​

guide(): this

Marks this sketch geometry as construction geometry. Guide geometries are excluded from the final sketch output (e.g., extrude, revolve) unless explicitly included.


edge()​

edge(roleOrIndex: string | number, roleIndex?: number): ISelection

Uniform edge accessor. edge('body') selects this feature's edges by role (optionally disambiguated by role index); edge(1) selects by build-order index over the feature's real edges. Roles: solver lines and arcs stamp body; circles and ellipses perimeter; derived-op outputs carry provenance-specific roles (e.g. fillet arcs).

Returns: ISelection

ParameterTypeDescription
roleOrIndexstring | numberA role name, or a build-order edge index.
roleIndexnumberDisambiguates roles that repeat. (optional)

start()​

start(): Vertex

Returns a lazy-evaluated vertex at the start point of this geometry element.

Returns: Vertex


end()​

end(): Vertex

Returns a lazy-evaluated vertex at the end point of this geometry element.

Returns: Vertex

Inherited from SceneObject

name()​

name(value: string): this

Sets a custom display name for this object, overriding the default type-based name.

ParameterTypeDescription
valuestringThe display name to assign.

Methods​

size()​

size(value: number): this

Sets the text height (em size) in model units. Default 10.

ParameterTypeDescription
valuenumberThe em size.

at()​

at(position: [number, number]): this

Places the text anchor at an explicit local position. Default: the sketch plane origin. Not applicable to text following a path.

ParameterTypeDescription
position[number, number]The anchor point in sketch coordinates.

anchor()​

anchor(): Vertex

Returns the anchor point — a solver point entity constraints can target, so the solve positions the text. Not applicable to text following a path.

Returns: Vertex


font()​

font(name: string): this

Sets the font. A name without a font extension (e.g. "Arial") is resolved to a system font; a value ending in .ttf/.otf/.ttc/.woff (e.g. "fonts/Brand.ttf") is loaded as a workspace-relative file. When omitted, a default system font is used.

ParameterTypeDescription
namestringA system family name or a workspace-relative font file path.

weight()​

weight(value: string | number): this

Sets the font weight: a number (100–900) or a name such as "regular", "medium", or "bold". Resolves to the matching face (or the wght axis of a variable font).

ParameterTypeDescription
valuestring | numberThe weight as a number or name.

bold()​

bold(): this

Shortcut for weight(700).


italic()​

italic(value?: boolean): this

Renders the italic/oblique face of the font.

ParameterTypeDescription
valuebooleanWhether to use italic (defaults to true). (optional)

align()​

align(value: "left" | "right" | "start" | "end" | "center" | "space-between" | "space-around"): this

Horizontal alignment of the text. For straight text it is relative to the origin point; for text along a path it positions the run against the path: "start" begins at the path's start, "center" centers on the midpoint, "end" finishes at the path's end, "space-between" justifies the glyphs evenly across the whole path, and "space-around" spreads them with half a gap before the first glyph and after the last, like the CSS flexbox value (both path text only). "left" and "right" are synonyms of "start" and "end".

ParameterTypeDescription
value"left" | "right" | "start" | "end" | "center" | "space-between" | "space-around""left"/"start" (default), "center", "right"/"end", "space-between", or "space-around".

lineSpacing()​

lineSpacing(value: number): this

Line-height multiplier for multi-line text (newlines in the string).

ParameterTypeDescription
valuenumberMultiplier on the font's natural line height (default 1).

letterSpacing()​

letterSpacing(value: number): this

Extra spacing added between glyphs, in model units (default 0).

ParameterTypeDescription
valuenumberThe additional advance per glyph.

offset()​

offset(value: number): this

Shifts the baseline perpendicular to the path, in model units: positive values move the text toward its "up" side, negative below the path. Only applies to text following a path (text(string, path)).

ParameterTypeDescription
valuenumberThe perpendicular baseline shift.

flip()​

flip(value?: boolean): this

Mirrors the text to the other side of the path, reversing the reading direction. On a closed path (circle, loop) text sits on the outside by default — .flip() moves it inside. On an open path it mirrors the text below the curve. Only applies to text following a path.

ParameterTypeDescription
valuebooleanWhether to flip (defaults to true). (optional)

startAt()​

startAt(distance: number): this

Shifts where the text starts along the path, as an arc-length distance from the path's start (combines with align()). On a closed path the text wraps around. Only applies to text following a path.

ParameterTypeDescription
distancenumberThe arc-length shift in model units.