Closed Julian-Rojo-Beezy closed 2 years ago
Hey!
Interesting. The code in Figmagic for this is rudimentary and fully expects that Figma's value is correct. Please see https://github.com/mikaelvesavuori/figmagic/blob/d4b37cb96bc0df8eb8ca64c6edf90ecce2907100/bin/entities/Token/logic/makeFontWeightTokens.ts#L39
I am indeed seeing the same behavior, for both Helvetica Neue and Inter. See below, for Inter, as I'm outputting the Figma frame data for font weights.
Writing Figma base file...
Writing design tokens...
---> {
fontFamily: 'Inter',
fontPostScriptName: 'Inter-Bold',
fontWeight: 700,
paragraphSpacing: 1,
textAutoResize: 'WIDTH_AND_HEIGHT',
fontSize: 16,
textAlignHorizontal: 'LEFT',
textAlignVertical: 'CENTER',
letterSpacing: 0,
lineHeightPx: 18.75,
lineHeightPercent: 100,
lineHeightUnit: 'INTRINSIC_%'
}
Figmagic completed operations successfully!
~/Web/figmagic main ± npm run figmagic
> figmagic@4.4.0 figmagic
> node build/index.js
Attempting to fetch data from Figma API...
Writing Figma base file...
Writing design tokens...
---> {
fontFamily: 'Inter',
fontPostScriptName: 'Inter-SemiBold',
fontWeight: 400,
paragraphSpacing: 1,
textAutoResize: 'WIDTH_AND_HEIGHT',
fontSize: 16,
textAlignHorizontal: 'LEFT',
textAlignVertical: 'CENTER',
letterSpacing: 0,
lineHeightPx: 18.75,
lineHeightPercent: 100,
lineHeightUnit: 'INTRINSIC_%'
}
Figmagic completed operations successfully!
~/Web/figmagic main ± npm run figmagic
> figmagic@4.4.0 figmagic
> node build/index.js
Attempting to fetch data from Figma API...
Writing Figma base file...
Writing design tokens...
---> {
fontFamily: 'Inter',
fontPostScriptName: 'Inter-ExtraLight',
fontWeight: 400,
paragraphSpacing: 1,
textAutoResize: 'WIDTH_AND_HEIGHT',
fontSize: 16,
textAlignHorizontal: 'LEFT',
textAlignVertical: 'CENTER',
letterSpacing: 0,
lineHeightPx: 18.75,
lineHeightPercent: 100,
lineHeightUnit: 'INTRINSIC_%'
}
Figmagic completed operations successfully!
~/Web/figmagic main ± npm run figmagic
> figmagic@4.4.0 figmagic
> node build/index.js
Attempting to fetch data from Figma API...
Writing Figma base file...
Writing design tokens...
---> {
fontFamily: 'Inter',
fontPostScriptName: 'Inter-Thin',
fontWeight: 100,
paragraphSpacing: 1,
textAutoResize: 'WIDTH_AND_HEIGHT',
fontSize: 16,
textAlignHorizontal: 'LEFT',
textAlignVertical: 'CENTER',
letterSpacing: 0,
lineHeightPx: 18.75,
lineHeightPercent: 100,
lineHeightUnit: 'INTRINSIC_%'
}
Figmagic completed operations successfully!
This seems to be an error on Figma's side, and I think the right course of action is to raise an issue in their support.
This seems to be the same thing, if also the font name has spaces, but the font style does not. Tried with Iowan Old Style
, font style Titling
: Came back as 400.
EDIT: Well my theory obviously does not hold up, given that the well-working Helvetica Neue also has a space in it.
Thanks for the information!
Yep, looks like the space in the family name doesn't trigger the problem: I checked with "Noto Sans" (space in family name, but not in weights) and the issue doesn't happen
Is it OK to close this for now since it is not directly related to Figmagic?
Describe the bug Font weight values are exported as "400" when there is a whitespace in their names in the Figma font-weight selector (e.g. in the "Inter" font).
To Reproduce
fontWeights
tokens. Those that have a whitespace in Figma are exported as 400 in all the cases.Expected behavior The value of those tokens should be the same as the ones shown in the Typography section.
Screenshots
![imagen](https://user-images.githubusercontent.com/70134058/141319771-86a308b1-8473-4866-8315-44043c0e67cc.png)
Desktop (please complete the following information):
Additional context
usePostscriptFontNames
has no effect on the wrong weight values.