Skip to main content

Font Style name export to JSON


Tanya_Serdyukova

Hi Figma developers!

It turns out that exporting Figma fonts in JSON format provides the result that looks smth like this:

                            "style": {
                                "fontFamily": "Quattrocento Sans",
                                "fontPostScriptName": "QuattrocentoSans-BoldItalic",
                                "fontSize": 72,
                                "fontWeight": 700,
                                "italic": true,
                                "letterSpacing": 0,
                                "lineHeightPercent": 100,
                                "lineHeightPx": 84.375,
                                "lineHeightUnit": "INTRINSIC_%",
                                "textAlignHorizontal": "CENTER",
                                "textAlignVertical": "CENTER"
                            },

for a page like this:

And we face the necessity to invent some special algorithms for knowing the actual style name (that is “Bold Italic” in the example)
from the provided “fontPostScriptName” field (that is “QuattrocentoSans-BoldItalic” in the example).

Is there any chance to add the real style name to the structure? It would be very much appreciated.

2 replies

Rasmus_Hjulskov_Larsen

With a font like Inter the fontWeight doesn’t match what I see in Figma but fallback to 400.
Adding custom logic based on the fontPostScriptName seems really hacky, is that what’s intended? 🙂


How did you export the Figma fonts to JSON? I cant see how to do it


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