Figma Support Forum

Set italic in TextNode with plugin API


I am trying with a plugin to re-integrate properties on text nodes, which are previously extracted via the REST API.
However, I can’t seem to find the solution to reestablish the “italic” property on a node.

By browsing the different documentations, I saw that it was possible to do it on Figjam widgets, I did not find an equivalent for the plugins. So I am wondering if the feature is available or if there is a way around the problem?

Thank you in advance for your answers !

You need to load and set the FontName with the style you need. TextNode · Figma Developers

1 Like

Yes, I saw this by calling the figma.listAvailableFontsAsync() method which returns the style with the “Italic”. It would miss a precision at the level of the FontName on the TexteNode in the documentation page, because the REST API returns an italic property on the style object. Also, this is confusing as one would expect this to be only the type of police grease.

Thank you very much for answering me!
Have a good weekend.