Text sublayer nodes are pared-back versions of text nodes: they have most text properties (except
textAutoResize, which are not editable on these nodes' text sublayers), as well as
fills. They aren't resizable or repositionable.
You set text content as you would for any other text node (e.g.
sticky.text.characters = 'some text'). As with all other text operations in Figma, you'll need to ensure fonts are loaded.
Returns a string representation of the node. For debugging purposes only, do not rely on the exact output of this string in production code. [Read more]
parent: (BaseNode & ChildrenMixin) | null [readonly]
Text node traits
Returns whether the text uses a font currently not available to the document.
textAlignHorizontal: "LEFT" | "CENTER" | "RIGHT" | "JUSTIFIED"
The horizontal alignment of the text with respect to the textbox. Setting this property requires the font the be loaded.
The indentation of paragraphs (offset of the first line from the left). Setting this property requires the font the be loaded.
The vertical distance between paragraphs. Setting this property requires the font to be loaded.
The raw characters in the text node. Setting this property requires the font the be loaded. [Read more]
insertCharacters(start: number, characters: string, useStyle?: "BEFORE" | "AFTER"): void
characters at index
start in the text. [Read more]
deleteCharacters(start: number, end: number): void
Remove characters in the text from
start (inclusive) to
end (exclusive). [Read more]
The size of the font. Has minimum value of 1.
The font family (e.g. "Roboto"), and font style (e.g. "Regular"). Setting this property to a different value requires the new font to be loaded.
Overrides the case of the raw characters in the text node. Requires the font to be loaded.
Whether the text is underlined or has a strikethrough. Requires the font to be loaded.
The spacing between the individual characters. Requires the font to be loaded.
The spacing between the lines in a paragraph of text. Requires the font to be loaded.
The id of the
TextStyle object that the text properties of this node are linked to. Requires the font to be loaded.
Text range functions
TextSublayer has all of TextNode's text range functions.