material-roboto-font-loader-ios
material-roboto-font-loader-ios copied to clipboard
Fallback font for roboto
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.
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.
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.
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.
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.
Can you try using bold and see if you still have the same problem?
_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:
I would recommend against using fontWithSize: on System Font
Change medium to bold was the fix I implemented, the difference was visible.
@ShepJGoogle in my tests i found that [UIFont boldSystemFontOfSize:20] would return SF Semi-Bold