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 Link icon

    • make Link icon

      @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 Link icon

      @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 Link icon

      public void getBounds(@Nonnull Rect2f bounds)
    • getRunCount Link icon

      @Internal public int getRunCount()
    • getFonts Link icon

      @Internal public Font[] getFonts()
    • getCounts Link icon

      @Internal public int[] getCounts()
    • getGlyphs Link icon

      @Internal public int[] getGlyphs()
    • getPositions Link icon

      @Internal public float[] getPositions()
    • equals Link icon

      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