Class TextBlobBuilder

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class TextBlobBuilder
    extends Managed
    • Field Summary

      • Fields inherited from class io.github.humbleui.skija.impl.Native

        _ptr
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void _nAppendRun​(long ptr, long fontPtr, short[] glyphs, float x, float y, io.github.humbleui.types.Rect bounds)  
      static void _nAppendRunPos​(long ptr, long fontPtr, short[] glyphs, float[] pos, io.github.humbleui.types.Rect bounds)  
      static void _nAppendRunPosH​(long ptr, long fontPtr, short[] glyphs, float[] xs, float y, io.github.humbleui.types.Rect bounds)  
      static void _nAppendRunRSXform​(long ptr, long fontPtr, short[] glyphs, float[] xform)  
      static long _nBuild​(long ptr)  
      static long _nGetFinalizer()  
      static long _nMake()  
      TextBlobBuilder appendRun​(Font font, short[] glyphs, float x, float y, @Nullable io.github.humbleui.types.Rect bounds)
      Glyphs are positioned on a baseline at (x, y), using font metrics to determine their relative placement.
      TextBlobBuilder appendRun​(Font font, java.lang.String text, float x, float y)
      Glyphs are positioned on a baseline at (x, y), using font metrics to determine their relative placement.
      TextBlobBuilder appendRun​(Font font, java.lang.String text, float x, float y, @Nullable io.github.humbleui.types.Rect bounds)
      Glyphs are positioned on a baseline at (x, y), using font metrics to determine their relative placement.
      TextBlobBuilder appendRunPos​(Font font, short[] glyphs, io.github.humbleui.types.Point[] pos)
      Glyphs are positioned at positions from pos.
      TextBlobBuilder appendRunPos​(Font font, short[] glyphs, io.github.humbleui.types.Point[] pos, @Nullable io.github.humbleui.types.Rect bounds)
      Glyphs are positioned at positions from pos.
      TextBlobBuilder appendRunPosH​(Font font, short[] glyphs, float[] xs, float y)
      Glyphs are positioned on a baseline at y, using x-axis positions from xs.
      TextBlobBuilder appendRunPosH​(Font font, short[] glyphs, float[] xs, float y, @Nullable io.github.humbleui.types.Rect bounds)
      Glyphs are positioned on a baseline at y, using x-axis positions from xs.
      TextBlobBuilder appendRunRSXform​(Font font, short[] glyphs, RSXform[] xform)  
      @Nullable TextBlob build()
      Returns TextBlob built from runs of glyphs added by builder.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • build

        @Nullable
        public @Nullable TextBlob build()

        Returns TextBlob built from runs of glyphs added by builder. Returned TextBlob is immutable; it may be copied, but its contents may not be altered. Returns null if no runs of glyphs were added by builder.

        Resets TextBlobBuilder to its initial empty state, allowing it to be reused to build a new set of runs.

        Returns:
        SkTextBlob or null
        See Also:
        https://fiddle.skia.org/c/@TextBlobBuilder_make
      • appendRun

        public TextBlobBuilder appendRun​(Font font,
                                         java.lang.String text,
                                         float x,
                                         float y)
        Glyphs are positioned on a baseline at (x, y), using font metrics to determine their relative placement.
        Parameters:
        font - Font used for this run
        text - Text to append in this run
        x - horizontal offset within the blob
        y - vertical offset within the blob
        Returns:
        this
      • appendRun

        public TextBlobBuilder appendRun​(Font font,
                                         java.lang.String text,
                                         float x,
                                         float y,
                                         @Nullable
                                         @Nullable io.github.humbleui.types.Rect bounds)

        Glyphs are positioned on a baseline at (x, y), using font metrics to determine their relative placement.

        bounds defines an optional bounding box, used to suppress drawing when TextBlob bounds does not intersect Surface bounds. If bounds is null, TextBlob bounds is computed from (x, y) and glyphs metrics.

        Parameters:
        font - Font used for this run
        text - Text to append in this run
        x - horizontal offset within the blob
        y - vertical offset within the blob
        bounds - optional run bounding box
        Returns:
        this
      • appendRun

        public TextBlobBuilder appendRun​(Font font,
                                         short[] glyphs,
                                         float x,
                                         float y,
                                         @Nullable
                                         @Nullable io.github.humbleui.types.Rect bounds)

        Glyphs are positioned on a baseline at (x, y), using font metrics to determine their relative placement.

        bounds defines an optional bounding box, used to suppress drawing when TextBlob bounds does not intersect Surface bounds. If bounds is null, TextBlob bounds is computed from (x, y) and glyphs metrics.

        Parameters:
        font - Font used for this run
        glyphs - glyphs in this run
        x - horizontal offset within the blob
        y - vertical offset within the blob
        bounds - optional run bounding box
        Returns:
        this
      • appendRunPosH

        public TextBlobBuilder appendRunPosH​(Font font,
                                             short[] glyphs,
                                             float[] xs,
                                             float y)

        Glyphs are positioned on a baseline at y, using x-axis positions from xs.

        Parameters:
        font - Font used for this run
        glyphs - glyphs in this run
        xs - horizontal positions on glyphs within the blob
        y - vertical offset within the blob
        Returns:
        this
      • appendRunPosH

        public TextBlobBuilder appendRunPosH​(Font font,
                                             short[] glyphs,
                                             float[] xs,
                                             float y,
                                             @Nullable
                                             @Nullable io.github.humbleui.types.Rect bounds)

        Glyphs are positioned on a baseline at y, using x-axis positions from xs.

        bounds defines an optional bounding box, used to suppress drawing when TextBlob bounds does not intersect Surface bounds. If bounds is null, TextBlob bounds is computed from (x, y) and glyphs metrics.

        Parameters:
        font - Font used for this run
        glyphs - glyphs in this run
        xs - horizontal positions of glyphs within the blob
        y - vertical offset within the blob
        bounds - optional run bounding box
        Returns:
        this
      • appendRunPos

        public TextBlobBuilder appendRunPos​(Font font,
                                            short[] glyphs,
                                            io.github.humbleui.types.Point[] pos)

        Glyphs are positioned at positions from pos.

        Parameters:
        font - Font used for this run
        glyphs - glyphs in this run
        pos - positions of glyphs within the blob
        Returns:
        this
      • appendRunPos

        public TextBlobBuilder appendRunPos​(Font font,
                                            short[] glyphs,
                                            io.github.humbleui.types.Point[] pos,
                                            @Nullable
                                            @Nullable io.github.humbleui.types.Rect bounds)

        Glyphs are positioned at positions from pos.

        bounds defines an optional bounding box, used to suppress drawing when TextBlob bounds does not intersect Surface bounds. If bounds is null, TextBlob bounds is computed from (x, y) and glyphs metrics.

        Parameters:
        font - Font used for this run
        glyphs - glyphs in this run
        pos - positions of glyphs within the blob
        bounds - optional run bounding box
        Returns:
        this
      • _nGetFinalizer

        @Internal
        public static long _nGetFinalizer()
      • _nMake

        @Internal
        public static long _nMake()
      • _nBuild

        @Internal
        public static long _nBuild​(long ptr)
      • _nAppendRun

        @Internal
        public static void _nAppendRun​(long ptr,
                                       long fontPtr,
                                       short[] glyphs,
                                       float x,
                                       float y,
                                       io.github.humbleui.types.Rect bounds)
      • _nAppendRunPosH

        @Internal
        public static void _nAppendRunPosH​(long ptr,
                                           long fontPtr,
                                           short[] glyphs,
                                           float[] xs,
                                           float y,
                                           io.github.humbleui.types.Rect bounds)
      • _nAppendRunPos

        @Internal
        public static void _nAppendRunPos​(long ptr,
                                          long fontPtr,
                                          short[] glyphs,
                                          float[] pos,
                                          io.github.humbleui.types.Rect bounds)
      • _nAppendRunRSXform

        @Internal
        public static void _nAppendRunRSXform​(long ptr,
                                              long fontPtr,
                                              short[] glyphs,
                                              float[] xform)