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

font-weight:light; not working correctly [Sketch issue] #19

Open
pfederi opened this issue Dec 20, 2019 · 13 comments
Open

font-weight:light; not working correctly [Sketch issue] #19

pfederi opened this issue Dec 20, 2019 · 13 comments

Comments

@pfederi
Copy link

pfederi commented Dec 20, 2019

font-weight:light; is not working with Roboto. Didn't try with other fonts.
When I apply the Design Tokens in Sketch the font-weight added is regular.

other Font-Styles as thin or bold are working correctly

@MaxBazarov
Copy link
Contributor

Thanks for the report. I will check it.

@MaxBazarov
Copy link
Contributor

Sketch handles font weight selection by UI and by API in slightly different ways.
As a result you can select Light or Thin weight in UI, but in Sketch API both weights are equal (3), so I can't set a valid value.

We met this problem before with other font and the only one solution which we found was to patch the font using FontForge.

@MaxBazarov
Copy link
Contributor

I will continue a research to workaround it somehow.

@MaxBazarov
Copy link
Contributor

Another solution is to uninstall Thin and Ultra Thin fonts. In this case font-weight:200 will select Light font.

@MaxBazarov
Copy link
Contributor

Ok, I submited a bug report to Sketch. Will keep you informed.

@MaxBazarov MaxBazarov changed the title font-weight:light; not working correctly font-weight:light; not working correctly [Sketch issue] Jan 10, 2020
@tijmenvangurp
Copy link

Sketch handles font weight selection by UI and by API in slightly different ways.
As a result you can select Light or Thin weight in UI, but in Sketch API both weights are equal (3), so I can't set a valid value.

We met this problem before with other font and the only one solution which we found was to patch the font using FontForge.

Do you know what the fix is in fontforge? I am running into the same issue.

@pfederi
Copy link
Author

pfederi commented Apr 15, 2020

@tijmenvangurp I found a workaround for the light Font doing it like this:
font-weight: thin; //thin because light is not working for the moment

That workaround is just working if you don't want to use all the font-weights.

@barmallion
Copy link

Maybe simple css don't have light font size? https://htmldog.com/references/css/properties/font-weight/

@MaxBazarov
Copy link
Contributor

@tijmenvangurp I tried to forget Fontforge dark magic. Because it's a nightmare.
But if I remember correctly — I changed these fields:
Screenshot 2020-04-15 at 23 13 35

@tijmenvangurp
Copy link

It might be that sketch is following https://docs.microsoft.com/en-us/typography/opentype/spec/os2#usweightclass the OpenType specs? I will try to change the weight names to what the open type has and see if that works.

@tijmenvangurp
Copy link

tijmenvangurp commented Apr 16, 2020

This fix worked for me.
I had to update the name in preferred styles from Xbold to extra-bold then if apply font-weight 800 it works :)

Btw, this fix is only needed for the people in the team using the plugin, since sketch does not see it as an actual different font in use.

image

@MaxBazarov
Copy link
Contributor

MaxBazarov commented Apr 16, 2020 via email

@tijmenvangurp
Copy link

In the end, I had to change 3 font-weight names. I followed this table and everything works

https://support.invisionapp.com/hc/en-us/articles/115003217203-How-does-Inspect-determine-the-font-weight-displayed-in-my-prototype-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants