I am using Raleway from Google Fonts as the main font for my project.
Everything was fine with it until I noticed that the numbers are displayed in "old-style" mode, which means that some digits have ascenders or descenders going up or down from the font's baseline. This harms readability for parts of the UI which render a lot of numbers.
In order to fix this I can use CSS to tweak some OpenType settings, as described here: https://www.codesmite.com/article/fixing-raleway-and-similar-fonts-numerals
Setting font-feature-settings
and/or font-variant-numric
works just fine on Firefox and Edge, but Chrome seems to ignore it for elements which have weight or style rules applied to them.
Basically any element which has a non-regular CSS value for font-weight
(e.g. bold
) or font-style
(e.g. italic
) will revert the numeral lining back to old-style. Also explicit lining rules (font-feature-settings: "lnum"
) on that particular element don't have any effect.
Is there any workaround for Chrome? Or is there a proper way to define the numeral lining globally?
I've illustrated this issue in a CodePen. If you open it in different browsers you will notice that IE and Firefox work as expected but Chrome and other webkit-based browsers render it as described above: https://codepen.io/anon/pen/LdVoJG