characters at index
start in the text.
insertCharacters(start: number, characters: string, useStyle?: 'BEFORE' | 'AFTER'): void
This API allows you to insert characters in a text node while preserving the styles of the existing characters. However, you still need to call
figma.loadFontAsync before using this API.
The style of the inserted characters will be copied from the preceding character if
useStyle is "BEFORE" or not provided. Otherwise, the style of inserted characters will be copied from the following character. If there is no preceding or following character (i.e.
start is at the boundary of the string), then the style will be copied from the closest existing character.