Renderables
Text
Text in your fonts, with size, weight, spacing, lines and alignment.
Object type renderable pins
A text is a Shape made of lines of text, drawn with
the fonts of the machine showing it. Like every shape it has a fill and a
stroke (no stroke by default), and it's placed by its position,
rotation and scale.
Hierarchy
- Parents
Shape→Renderable- Subtypes
- None
Properties
| Name | Type | Notes |
|---|---|---|
| position | Point | from Renderable |
| rotation | number | from Renderable |
| scale | number | from Renderable |
| opacity | number | read-only from Renderable |
| blendMode | BlendMode | read-only from Renderable |
| fill | Paint | from Shape |
| stroke | Stroke | from Shape |
| text | string | |
| fontFamily | string | |
| fallback | FontFallback | |
| fontSize | number | |
| fontWeight | number | |
| italic | boolean | |
| letterSpacing | number | |
| lineHeight | number | |
| align | TextAlign | |
| anchor | TextAnchor |
Nodes
Break Text
Node id break/Text
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| object | Text | type default |
Outputs
| Name | Type | Notes |
|---|---|---|
| position | Point | |
| rotation | number | |
| scale | number | |
| opacity | number | |
| blendMode | BlendMode | |
| fill | Paint | |
| stroke | Stroke | |
| text | string | |
| fontFamily | string | |
| fallback | FontFallback | |
| fontSize | number | |
| fontWeight | number | |
| italic | boolean | |
| letterSpacing | number | |
| lineHeight | number | |
| align | TextAlign | |
| anchor | TextAnchor |
Make Text
Node id make/Text
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| position | Point | { x: 0, y: 0 } | |
| rotation | number | 0 | |
| scale | number | 1 | |
| fill | Paint | { r: 128, g: 128, b: 128, a: 1 } | |
| stroke | Stroke | { width: 0, color: { r: 0, g: 0, b: 0, a: 1 }, dashStyle: "SOLID", caps: "round" } | |
| text | string | "Text" | |
| fontFamily | string | "" | |
| fallback | FontFallback | "sans-serif" | |
| fontSize | number | 32 | |
| fontWeight | number | 400 | |
| italic | boolean | false | |
| letterSpacing | number | 0 | |
| lineHeight | number | 1.2 | |
| align | TextAlign | "start" | |
| anchor | TextAnchor | "baseline" |
Outputs
| Name | Type | Notes |
|---|---|---|
| object | Text |
Set Text
Node id set/Text
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| object | Text | type default | |
| position | Point | — | |
| rotation | number | — | |
| scale | number | — | |
| fill | Paint | — | |
| stroke | Stroke | — | |
| text | string | — | |
| fontFamily | string | — | |
| fallback | FontFallback | — | |
| fontSize | number | — | |
| fontWeight | number | — | |
| italic | boolean | — | |
| letterSpacing | number | — | |
| lineHeight | number | — | |
| align | TextAlign | — | |
| anchor | TextAnchor | — |
Outputs
| Name | Type | Notes |
|---|---|---|
| object | Text |
Lerp Text
Node id lerp/Text
Inputs
Outputs
| Name | Type | Notes |
|---|---|---|
| result | Text |
Notes
- Lines. A line break in
textstarts a new line,lineHeighttimes thefontSizebelow the previous one. - Fonts.
fontFamilynames a font (for exampleGeorgia); where it isn't installed, or when it's empty, the text uses the generic FontFallback family instead. The same text can therefore look different on another computer, and so can a downloaded SVG. - Weight and italic.
fontWeightgoes from 1 to 1000 (400 is normal, 700 bold);italicslants it. A font without that weight or style shows the nearest one it has. - Spacing.
letterSpacingadds space after each character, in px. - Placement. TextAlign places each line left of, around or right of the position; TextAnchor says whether the position is at the top, the baseline, the middle or the bottom of the text.
- Default. Make Text gives "Text" in 32 px sans-serif, gray, starting at its position on the baseline.
- Boxes. AABB and OOBB give the box of the text as drawn. Text has no outline: path nodes such as Sample or Length report an error.
Lerp
Lerp Text blends the size, letter spacing, line height, transform, fill and
stroke. The text itself and the other settings (font, weight, italic,
alignment, anchor) come from a below t = 0.5, and from b from 0.5 on.
t is clamped to 0, 1.