Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99bc70c0 authored by Sally Yuen's avatar Sally Yuen Committed by Android (Google) Code Review
Browse files

Merge "[Bold text] Use a default bold font for null typefaces" into main

parents 461a2bd5 b82c54b7
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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
  }
}
+5 −1
Original line number Diff line number Diff line
@@ -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),