Skip to main content

How do you apply bold or fontWeight to a text range using the API?


The following works for underline:

textNode.setRangeTextDecoration(index, index + length, ‘UNDERLINE’);


But the following does not appear to work for bold:

textNode.setRangeTextStyleIdAsync(index, index + length, ‘bold’);


What is the correct way to use the API to format a range of characters within a text node please?

Use setRangeFontName


figma.com

Font name is family + style:


{ family: "Inter", style: "Bold" }