Looking for a font challenge?
We've discovered that the Roboto
font has a slim version that can be specified in CSS using font-weight: lighter
or a weight value below 400.
By using the rule
font-weight: 200; font-family: Roboto;
, we were able to get Firefox on Android to display the correct font version, as well as most major desktop browsers (if the font is available).
However, Chrome on Android seems to always default to the regular Roboto font.
We tried different syntax alternatives such as:
font-weight: lighter; font-family: Roboto;
font-family: 'Roboto Thin';
font-weight: 200; font-family: 'Roboto Thin';
Unfortunately, Chrome still prefers the regular version.
What about this approach?
@font-face {
font-family: "Roboto";
font-weight: 200;
src: local("Roboto-Thin");
}
font-family: Roboto;
font-weight: 200;
It seems that this method resulted in a bug that won't be fixed: http://code.google.com/p/chromium/issues/detail?id=322658
The team suggested an alternative:
@font-face {
font-family: "Roboto";
font-weight: 200;
src: local("sans-serif-thin");
}
font-family: Roboto;
font-weight: 200;
However, this solution didn't work on our testing devices (OS 4.1.2 with Chrome stable/beta) either.
The fallback option to web font does work on Chrome beta after being fixed in http://code.google.com/p/chromium/issues/detail?id=167557
Yet, using a web font fallback for a system font seems odd and can cause delays in content display due to extra downloads.
Do you have a better workaround for this issue?
Test cases: