Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

Fallback font for roboto #12

Open
gambard opened this issue Mar 6, 2017 · 7 comments
Open

Fallback font for roboto #12

gambard opened this issue Mar 6, 2017 · 7 comments

Comments

@gambard
Copy link

gambard commented Mar 6, 2017

Roboto does not have characters for Arabic languages. It seems that the fallback font used in this case does not care about the style used, i.e. when using medium font, it is displayed as regular font.

@randallli
Copy link
Contributor

The version of roboto that we are using only has Latin glyphs. It falls back to the system font for individual glyphs when they are missing. They should be coming in as medium though. @ShepJGoogle found a bug with fontWithSize: losing medium weight when you use the system font.

@gambard
Copy link
Author

gambard commented Mar 16, 2017

Thanks! http://crbug.com/698716 is showing the difference in weight, using Roboto and the default font. This screenshot show an Arabic test which should contains normal and medium font. No difference is visible.
simulator screen shot feb 3 2017 10 28 56 am

I am not sure I understand the bug you are describing with the fontWithSize:. Does this mean that when the library fall back for the system font it looses the medium weight?
I am using fontWithSize: to get the font, so it would explain the bug.

@randallli
Copy link
Contributor

The material spec calls for bold when using tall languages. https://material.io/guidelines/style/typography.html#typography-styles
We having come up with a good way to not only serve roboto with Arabic and change the weight when we do.

@randallli
Copy link
Contributor

Can you try using bold and see if you still have the same problem?

@ShepJGoogle
Copy link

ShepJGoogle commented Mar 16, 2017

_titleFont = [UIFont systemFontOfSize:20 weight:UIFontWeightBold];
_titleLabel.font = [_titleFont fontWithSize:_titleFont.pointSize * scaleFactor];

The above returns San Fransisco Semi-Bold on when called bold as shown below:
screen shot 2017-03-16 at 12 17 07 pm

I would recommend against using fontWithSize: on System Font

@gambard
Copy link
Author

gambard commented Mar 16, 2017

Change medium to bold was the fix I implemented, the difference was visible.

@randallli
Copy link
Contributor

@ShepJGoogle in my tests i found that [UIFont boldSystemFontOfSize:20] would return SF Semi-Bold

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

No branches or pull requests

3 participants