fontWeight
is an inherent property of text style. But figma.getStyleById
for a text style doesn’t return the fontWeight
property?
Why though?
fontWeight
is an inherent property of text style. But figma.getStyleById
for a text style doesn’t return the fontWeight
property?
Why though?
Best answer by Gleb
That’s not how it works. fontWeight
is not even a property you can set — it’s a readonly property, you can only read it. fontWeight is just a derivative of the chosen fontName
, which includes the weight (style
) in text format.
Plus, this property was added for text nodes only recently — all the hundreds of plugins that were released before that worked fine without it.
You only need fontName
, since fontWeight
is directly derived from fontName
. If you set the correct fontName
, fontWeight
would be correct as well.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.