Package icyllis.arc3d.core
Class TextBlob
java.lang.Object
icyllis.arc3d.core.TextBlob
TextBlob combines multiple text runs into an immutable container. Each text
run consists of glyphs, positions, and Paint. Only parts of Paint related to
fonts and text rendering are used by run.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Helper class for constructing TextBlob. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Special implementation of equals.Returns bounding box in pixels.void
int[]
Font[]
getFonts()
int[]
float[]
int
static TextBlob
make
(int[] glyphs, int glyphOffset, float[] positions, int positionOffset, int glyphCount, Font font, Rect2fc bounds) Returns a text blob built from a single run of text with positions.
-
Method Details
-
make
@Nullable public static TextBlob make(@Nonnull int[] glyphs, int glyphOffset, @Nonnull float[] positions, int positionOffset, int glyphCount, @Nonnull Font font, @Nullable Rect2fc bounds) Returns a text blob built from a single run of text with positions. This is equivalent to using TextBlobBuilder and calling allocRunPos(). Returns null if glyphCount is zero.- Parameters:
glyphs
- the array of glyphIDs to drawpositions
- where to draw each glyph relative to originglyphCount
- number of glyphs to drawfont
- typeface, text size and so, used to describe the text- Returns:
- new text blob or null
-
getBounds
Returns bounding box in pixels. Returned bounds may be larger than the bounds of all glyphs in runs when drawing to Canvas.- Returns:
- bounding box, may be conservative
-
getBounds
-
getRunCount
@Internal public int getRunCount() -
getFonts
-
getCounts
@Internal public int[] getCounts() -
getGlyphs
@Internal public int[] getGlyphs() -
getPositions
@Internal public float[] getPositions() -
equals
Special implementation of equals. In addition to strong reference equality, it can also be compared with Reference.
-