AndroidCompat: Use NotoSans as default font (#1572)

* Initial Noto fonts

* Use Noto for other default fonts

* Typeface: Prefer main font

Eagerly switch back to main font as soon as it can display again;
otherwise we might never switch back (or later than necessary); we
should always prefer the main font

* fix: Font metrics with fallback font on TextLine
This commit is contained in:
Constantin Piber
2025-08-19 22:00:59 +03:00
committed by GitHub
parent 283e38c30a
commit b2cfb5a1e9
14 changed files with 221 additions and 29 deletions

View File

@@ -366,9 +366,8 @@ public class StaticLayout extends Layout {
mRightIndents = b.mRightIndents;
String str = b.mText.subSequence(b.mStart, b.mEnd).toString();
AttributedString text = new AttributedString(str);
text.addAttribute(TextAttribute.FONT, getPaint().getFont());
FontRenderContext frc = new FontRenderContext(getPaint().getFont().getTransform(), RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT, RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT);
AttributedString text = getPaint().getTypeface().createWithFallback(str);
FontRenderContext frc = new FontRenderContext(null, RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT, RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT);
LineBreakMeasurer measurer = new LineBreakMeasurer(text.getIterator(), frc);
// TODO: directions