Status Update
Comments
ad...@google.com <ad...@google.com> #2
si...@google.com <si...@google.com>
ad...@google.com <ad...@google.com> #3
Please use fontFamily="google-sans"
, or in case of code, please use the
val regular = Typeface.create("google-sans", Typeface.NORMAL)
val medium = Typeface.create(regular, 500, false)
ri...@gmail.com <ri...@gmail.com> #4
The problem is I can't force other apps to use the "correct" way. For example, Pixel Launcher and SystemUI from Android 12 Beta 2 use "google-sans-medium".
In my case (I'm a Chinese language user), the app title in Pixel Launcher and the notification title in SystemUI display English characters in 500 weight correctly, but Chinese characters are displayed in 400 weight. This may because "google-sans-medium" is 400 weight so that the missing CJK characters are fallback with 400 weight.
This is the same for any other languages that use characters which not contains in GoogleSans.
I know Pixel devices do not have 500 weight font for CJK language, but OEMs (at least Xiaomi and OnePlus) have. I believe this problem should not be ignored.
Description
Are you an Android developer?"
Y
Which Android Developer Preview build are you using? See Settings > About phone > Build number (for example RPP1.200123.000).
SPB2.210513.007
Is this a regression from Android 11 to 12?
No
What device are you using? (for example, Pixel 4 XL)
Pixel 4
What are the steps to reproduce the problem? (Please provide the minimal reproducible test case.)
android.graphics.Typeface.create("google-sans-medium", Typeface.NORMAL).getWeight();
Issue Category e.g. Framework (platform), NDK (platform), Hardware (CPU, GPU, Sensor, Camera), ART (platform), Runtime Permissions etc
Framework
What was the expected result?
500
What was the actual result?
400
Related parts in
/product/etc/fonts_customization.xml
:The result should be 500 instead of 400.
Any other fonts in
/product/etc/fonts_customization.xml
all return 400 weight no matter how the XML defines.This will cause problems when displaying characters which not in the font file defined by fonts_customization XML.
This problem first appears in Android 12 Beta 1.