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.
  • 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