Loading core/java/android/text/flags/flags.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -201,3 +201,13 @@ flag { purpose: PURPOSE_BUGFIX } } flag { name: "fix_null_typeface_bolding" namespace: "text" description: "Use a bold typeface when bolding is enabled and the original typeface is null" bug: "314811487" metadata { purpose: PURPOSE_BUGFIX } } core/java/android/widget/TextView.java +5 −1 Original line number Diff line number Diff line Loading @@ -4817,7 +4817,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener if (mFontWeightAdjustment != 0 && mFontWeightAdjustment != Configuration.FONT_WEIGHT_ADJUSTMENT_UNDEFINED) { if (tf == null) { if (Flags.fixNullTypefaceBolding()) { tf = Typeface.DEFAULT_BOLD; } else { tf = Typeface.DEFAULT; } } else { int newWeight = Math.min( Math.max(tf.getWeight() + mFontWeightAdjustment, FontStyle.FONT_WEIGHT_MIN), Loading Loading
core/java/android/text/flags/flags.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -201,3 +201,13 @@ flag { purpose: PURPOSE_BUGFIX } } flag { name: "fix_null_typeface_bolding" namespace: "text" description: "Use a bold typeface when bolding is enabled and the original typeface is null" bug: "314811487" metadata { purpose: PURPOSE_BUGFIX } }
core/java/android/widget/TextView.java +5 −1 Original line number Diff line number Diff line Loading @@ -4817,7 +4817,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener if (mFontWeightAdjustment != 0 && mFontWeightAdjustment != Configuration.FONT_WEIGHT_ADJUSTMENT_UNDEFINED) { if (tf == null) { if (Flags.fixNullTypefaceBolding()) { tf = Typeface.DEFAULT_BOLD; } else { tf = Typeface.DEFAULT; } } else { int newWeight = Math.min( Math.max(tf.getWeight() + mFontWeightAdjustment, FontStyle.FONT_WEIGHT_MIN), Loading