Interfaces

Interfaces describe the shape of JavaScript objects that are accepted as arguments to functions, or are returned as results. The names of these interfaces can't be referred to in code. They exist here for documentation purposes.

ClosestPointResult

The return type for geometry closestPoint queries.

Properties

.positionVec

The position of the closest point.

ClosestPointResultWithTime

Return type for geometry closestPoint queries on types addressable by time, such as paths, segments, and axes.

Properties

.positionVec

The position of the closest point.

.geometryGeometryoptional

Contains a reference to the geometry that time applies to. This is necessary when finding a closest point on a group or compound path, since time will apply to one of the sub-paths.

.timenumber

The position of the closest point, expressed as time along the path, segment or axis.

GeometryPrimitive

Geometry types that can be intersected implement this interface.

Methods

.positionAtTime(time)Vec
time
number

Returns the position on the primitive at time.

RenderLineResult

The result type for Font.renderLine().

Properties

.advanceXnumber

The combined advanceX from all glyphs in this line of text. This roughly amounts to a "width" of the line and is used when horizontally aligning text.

.advanceWidthnumber

Contains the same value as advanceX. This property is present for compatibility with older modifiers.

.geometryGroup

The geometry associated with this line of text.

FontRenderOptions

Options for rendering text with a font.

Properties

.letterSpacingnumber

Additional spacing to add in-between letters. If provided, this value will be added to the advance width of every glyph.

.thickennumber

Percent

.lineHeightnumber

Line height, percent

.connect("none" | "dots and letters" | "dots")

Connected text

.capitalize("none" | "lowercase" | "uppercase")

Text transform

.ligatures("all" | "none")

Ligatures

.startStyle("none" | "tail")

Hearts and tails

.endStyle("none" | "tail" | "heart")
.betweenStyle("auto" | "none" | "heart")

TransformArgs

A user specified object literal specifying one or more affine transformations in 2D space.

All properties are optional. If no transform properties are specified, the transform is assumed to be the identity, meaning there would be no change after the transformation is applied.

Properties

.positionVecoptional
.rotationnumberoptional
.scale(number | Vec)optional
.skewnumberoptional
.originVecoptional

Transform

A collection of affine transformations in 2D space.

Properties

.positionVec
.rotationnumber
.scaleVec
.skewnumber

TransformWithOrigin

A collection of affine transformations in 2D space.

The origin property is used as the center of the rotation, scale, and skew transformations.

Properties

.positionVec
.rotationnumber
.scaleVec
.skewnumber
.originVec

DistanceToIntersectOptions

The options argument type for Geometry.distanceToIntersect.

Properties

.minOverlapnumberoptional

If specified, at least two intersection points must be this far apart to consider the intersection "close enough". This can be useful to ensure that the width of the overlapping region is thick enough to not break easily, for example.

IntersectionResult

The return type for intersection queries.

Properties

The first geometry primitive.

The second geometry primitive.

.time1number

The the time along the first geometry primitive where the intersection was found.

.time2number

The the time along the second geometry primitive where the intersection was found.

.positionVec

The position of the intersection point.