Resolve styles by font table if not specified.
android:fontStyle and android:fontWeight is an optional attribute.
If they are missing, we are using non-italic 400 weight, but this is
not good idea. We should resolve these style value from font metadata.
Bug: 37988154
Test: am instrument -w -e class android.content.res.cts.ResourcesTest
android.content.cts/android.support.test.runner.AndroidJUnitRunner
Change-Id: I80a436cd3632d8c58fa3d8bdaedac73b95f61a8c
This commit is contained in:
@@ -233,8 +233,7 @@ public class Typeface {
|
||||
// TODO: Add ttc and variation font support. (b/37853920)
|
||||
if (!fontFamily.addFontFromAssetManager(mgr, fontFile.getFileName(),
|
||||
0 /* resourceCookie */, false /* isAsset */, 0 /* ttcIndex */,
|
||||
fontFile.getWeight(), fontFile.isItalic() ? STYLE_ITALIC : STYLE_NORMAL,
|
||||
null /* axes */)) {
|
||||
fontFile.getWeight(), fontFile.getItalic(), null /* axes */)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user