Skip to main content
Question

Seems like weight is missing in the properties

  • January 4, 2024
  • 1 reply
  • 200 views

Hi! I’m working on a plugin to import a typographic scale, and according to the docs, and the api, the font weight seems to be missing as a configurable property. TextStyle | Plugin API

I think this is a bug mainly because it’s part of what’s manually configurable as a textStyle, so it makes no sense to me for this single and very important property to be missing in the API.

This is not small as it makes it impossible for my plugin to achieve its purpose functionality, forcing the user to make manual corrections on the imported typographic scale.

Some similar plugins like TokenStudio seem to be over this bug somehow.

1 reply

Celine_D
Figmate
  • Community Support
  • 3381 replies
  • January 5, 2024

Hey Ignacio,
After checking internally with the eng team, here the workaround:

fontWeight is a derived property in text nodes so it is not directly modifiable. You need to set fontName: https://www.figma.com/plugin-docs/api/TextStyle/#fontnamewhich has a font style that maps to different weights depending on the font (Regular, Bold, etc…)

Hope this helps!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings