lukasoppermann / design-tokens

🎨 Figma plugin to export design tokens to json in an amazon style dictionary compatible format.
https://www.figma.com/community/plugin/888356646278934516/Design-Tokens
MIT License
953 stars 131 forks source link

Font weights are not extracted from custom font #305

Closed healtheloper closed 1 week ago

healtheloper commented 5 months ago

Thanks for making such a great plugin.

I am using custom fonts, Everything is fine, but the font weight is not extracted correctly.

When I looked at the code, it looks like my fonts are now in the format Font 1 Thin, Font 2 ExtraLight which is why it is not extracting properly.

I'll send a PR with a fix for this if needed.

lukasoppermann commented 5 months ago

Hey, the code that does this is here: https://github.com/lukasoppermann/design-tokens/blob/main/src/extractor/extractFonts.ts#L24

if your font uses a different naming system, you can add it via a PR.