Loading core/java/android/text/TextLine.java +2 −1 Original line number Diff line number Diff line Loading @@ -931,7 +931,8 @@ public class TextLine { float totalWidth = 0; final int numDecorations = decorations == null ? 0 : decorations.size(); if (needWidth || (c != null && (wp.bgColor != 0 || numDecorations != 0 || runIsRtl))) { if (needWidth || ((c != null || consumer != null) && (wp.bgColor != 0 || numDecorations != 0 || runIsRtl))) { totalWidth = getRunAdvance(wp, start, end, contextStart, contextEnd, runIsRtl, offset); } Loading core/java/android/text/TextShaper.java +5 −1 Original line number Diff line number Diff line Loading @@ -198,6 +198,10 @@ public class TextShaper { /** * Shape multi-styled text. * * In the LTR context, the shape result will go from left to right, thus you may want to draw * glyphs from left most position of the canvas. In the RTL context, the shape result will go * from right to left, thus you may want to draw glyphs from right most position of the canvas. * * @param text a styled text. * @param start a start index of shaping target in the text. * @param count a length of shaping target in the text. Loading @@ -215,7 +219,7 @@ public class TextShaper { try { tl.set(paint, text, start, start + count, mp.getParagraphDir(), mp.getDirections(start, start + count), mp.getDirections(0, count), false /* tabstop is not supported */, null, -1, -1 // ellipsis is not supported. Loading graphics/java/android/graphics/text/PositionedGlyphs.java +1 −2 Original line number Diff line number Diff line Loading @@ -170,9 +170,8 @@ public final class PositionedGlyphs { * @hide * * @param layoutPtr the address of native layout object. * @param paint a paint object */ public PositionedGlyphs(long layoutPtr, @NonNull Paint paint, float xOffset, float yOffset) { public PositionedGlyphs(long layoutPtr, float xOffset, float yOffset) { mLayoutPtr = layoutPtr; int glyphCount = nGetGlyphCount(layoutPtr); mFonts = new ArrayList<>(glyphCount); Loading graphics/java/android/graphics/text/TextRunShaper.java +3 −3 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ public class TextRunShaper { return new PositionedGlyphs( nativeShapeTextRun(text, start, count, contextStart, contextCount, isRtl, paint.getNativeInstance()), paint, xOffset, yOffset); xOffset, yOffset); } /** Loading Loading @@ -104,7 +104,7 @@ public class TextRunShaper { nativeShapeTextRun( (String) text, start, count, contextStart, contextCount, isRtl, paint.getNativeInstance()), paint, xOffset, yOffset); xOffset, yOffset); } else { char[] buf = new char[contextCount]; TextUtils.getChars(text, contextStart, contextStart + contextCount, buf, 0); Loading @@ -112,7 +112,7 @@ public class TextRunShaper { nativeShapeTextRun( buf, start - contextStart, count, 0, contextCount, isRtl, paint.getNativeInstance()), paint, xOffset, yOffset); xOffset, yOffset); } } Loading Loading
core/java/android/text/TextLine.java +2 −1 Original line number Diff line number Diff line Loading @@ -931,7 +931,8 @@ public class TextLine { float totalWidth = 0; final int numDecorations = decorations == null ? 0 : decorations.size(); if (needWidth || (c != null && (wp.bgColor != 0 || numDecorations != 0 || runIsRtl))) { if (needWidth || ((c != null || consumer != null) && (wp.bgColor != 0 || numDecorations != 0 || runIsRtl))) { totalWidth = getRunAdvance(wp, start, end, contextStart, contextEnd, runIsRtl, offset); } Loading
core/java/android/text/TextShaper.java +5 −1 Original line number Diff line number Diff line Loading @@ -198,6 +198,10 @@ public class TextShaper { /** * Shape multi-styled text. * * In the LTR context, the shape result will go from left to right, thus you may want to draw * glyphs from left most position of the canvas. In the RTL context, the shape result will go * from right to left, thus you may want to draw glyphs from right most position of the canvas. * * @param text a styled text. * @param start a start index of shaping target in the text. * @param count a length of shaping target in the text. Loading @@ -215,7 +219,7 @@ public class TextShaper { try { tl.set(paint, text, start, start + count, mp.getParagraphDir(), mp.getDirections(start, start + count), mp.getDirections(0, count), false /* tabstop is not supported */, null, -1, -1 // ellipsis is not supported. Loading
graphics/java/android/graphics/text/PositionedGlyphs.java +1 −2 Original line number Diff line number Diff line Loading @@ -170,9 +170,8 @@ public final class PositionedGlyphs { * @hide * * @param layoutPtr the address of native layout object. * @param paint a paint object */ public PositionedGlyphs(long layoutPtr, @NonNull Paint paint, float xOffset, float yOffset) { public PositionedGlyphs(long layoutPtr, float xOffset, float yOffset) { mLayoutPtr = layoutPtr; int glyphCount = nGetGlyphCount(layoutPtr); mFonts = new ArrayList<>(glyphCount); Loading
graphics/java/android/graphics/text/TextRunShaper.java +3 −3 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ public class TextRunShaper { return new PositionedGlyphs( nativeShapeTextRun(text, start, count, contextStart, contextCount, isRtl, paint.getNativeInstance()), paint, xOffset, yOffset); xOffset, yOffset); } /** Loading Loading @@ -104,7 +104,7 @@ public class TextRunShaper { nativeShapeTextRun( (String) text, start, count, contextStart, contextCount, isRtl, paint.getNativeInstance()), paint, xOffset, yOffset); xOffset, yOffset); } else { char[] buf = new char[contextCount]; TextUtils.getChars(text, contextStart, contextStart + contextCount, buf, 0); Loading @@ -112,7 +112,7 @@ public class TextRunShaper { nativeShapeTextRun( buf, start - contextStart, count, 0, contextCount, isRtl, paint.getNativeInstance()), paint, xOffset, yOffset); xOffset, yOffset); } } Loading