Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text styles generating wrong weight #11

Open
bitfactory-lasse-vandenboschchristensen opened this issue Feb 21, 2020 · 8 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@bitfactory-lasse-vandenboschchristensen
Copy link

Hi @tbrasington,

Just trying out your plugin. Sweet work 👍

I'm encountering a small issue when generating styles. For a specific style i'm specifying 'Heavy' as a weight. However upon generating the styles 'Extra Bold' is generated as a style. I manually override this for now, but just wanted to give you a heads up on the issue.

Cheers

@tbrasington
Copy link
Owner

Hi @bitfactory-lasse-vandenboschchristensen thank you for the heads up. Let me check if its resolvable – there was an issue with how Sketch was handling font weights that was being looked at.

@tbrasington tbrasington self-assigned this Feb 24, 2020
@tbrasington tbrasington added the bug Something isn't working label Feb 24, 2020
@bitfactory-lasse-vandenboschchristensen

@tbrasington rock on :)

@rickcecil
Copy link

@tbrasington I am having a similar issue with a Light font. Instead of the Light weight, it is generating a Thin font.

@tbrasington
Copy link
Owner

Hey folks, what typefaces are you using? I can hopefully expand them for my testing.

@rickcecil
Copy link

Awesome. Thanks! Fonts are ... SF Pro Display and SF Pro Text

@tbrasington
Copy link
Owner

Hey everyone. So it seems that isn’t going to be possible with the current Sketch JS API.

So for example in the San Francisco case thin and light both report back their weight is 3. This is as the internals in the sketch api are using this function (https://developer.apple.com/documentation/appkit/nsfontmanager/1462351-weightoffont?language=objc) here (https://github.com/sketch-hq/SketchAPI/blob/26b1fe92a89871e2db8ec04ccc8af49c735407cd/Source/dom/style/Text.js#L491)

This only gives an approximation of the font weight which falls down when the font file isn’t mapped out in a certain way.

@RussellBishop
Copy link

Just had this bug too with TT Commons. What a shame!

@tbrasington
Copy link
Owner

Just had this bug too with TT Commons. What a shame!

It is possible to get around it if you have tools to adjust the font properties. Some reading here ingrammicro/puzzle-tokens#19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants