Interface TextShaper.GlyphsConsumer

Enclosing class:
TextShaper

public static interface TextShaper.GlyphsConsumer
A consumer interface for accepting text shape result.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(int start, int count, ShapedText glyphs, TextPaint paint, float offsetX, float offsetY)
    Accept text shape result.
  • Method Details

    • accept

      void accept(@IntRange(from=0L) int start, @IntRange(from=0L) int count, @NonNull ShapedText glyphs, @NonNull TextPaint paint, float offsetX, float offsetY)
      Accept text shape result.

      The implementation must not keep reference of paint since it will be mutated for the subsequent styles. Also, for saving heap size, keep only necessary members in the TextPaint instead of copying TextPaint object.

      Parameters:
      start - The start index of the shaped text.
      count - The length of the shaped text.
      glyphs - The shape result.
      paint - The paint to be used for drawing.
      offsetX - The additional X offset (relative to the left) of this style run.
      offsetY - The additional Y offset (relative to the top) of this style run.