Package icyllis.arc3d.core

# Class TextBlob

java.lang.Object
icyllis.arc3d.core.TextBlob

public final class TextBlob extends Object
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

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `TextBlob.Builder`
  Helper class for constructing TextBlob.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object o)`
  Special implementation of equals.
  `Rect2fc`
  `getBounds()`
  Returns bounding box in pixels.
  `void`
  `getBounds(Rect2f bounds)`
  `int[]`
  `getCounts()`
  `Font[]`
  `getFonts()`
  `int[]`
  `getGlyphs()`
  `float[]`
  `getPositions()`
  `int`
  `getRunCount()`
  `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.

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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 draw
      `positions` - where to draw each glyph relative to origin
      `glyphCount` - number of glyphs to draw
      `font` - typeface, text size and so, used to describe the text
    Returns:
      new text blob or null

  - ### getBounds

    @Nonnull public Rect2fc 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

    public void getBounds(@Nonnull Rect2f bounds)

  - ### getRunCount

    @Internal public int getRunCount()

  - ### getFonts

    @Internal public Font[] getFonts()

  - ### getCounts

    @Internal public int[] getCounts()

  - ### getGlyphs

    @Internal public int[] getGlyphs()

  - ### getPositions

    @Internal public float[] getPositions()

  - ### equals

    public boolean equals(Object o)
    Special implementation of equals. In addition to strong reference equality, it can also be compared with Reference.
    Overrides:
      `equals` in class `Object`