Class TextLine

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class TextLine
    extends Managed
    • Constructor Detail

      • TextLine

        @Internal
        public TextLine​(long ptr)
    • Method Detail

      • make

        @NotNull
        @Contract("_, _ -> new")
        public static @NotNull TextLine make​(java.lang.String text,
                                             Font font)
      • make

        @NotNull
        @Contract("_, _, _, _ -> new")
        public static @NotNull TextLine make​(java.lang.String text,
                                             Font font,
                                             ShapingOptions opts)
      • getAscent

        public float getAscent()
      • getCapHeight

        public float getCapHeight()
      • getXHeight

        public float getXHeight()
      • getDescent

        public float getDescent()
      • getLeading

        public float getLeading()
      • getWidth

        public float getWidth()
      • getHeight

        public float getHeight()
      • getTextBlob

        @Nullable
        public @Nullable TextBlob getTextBlob()
      • getGlyphs

        public short[] getGlyphs()
      • getPositions

        public float[] getPositions()
        Returns:
        [x0, y0, x1, y1, ...]
      • getOffsetAtCoord

        public int getOffsetAtCoord​(float x)
        Parameters:
        x - coordinate in px
        Returns:
        UTF-16 offset of glyph
      • getLeftOffsetAtCoord

        public int getLeftOffsetAtCoord​(float x)
        Parameters:
        x - coordinate in px
        Returns:
        UTF-16 offset of glyph strictly left of coord
      • getCoordAtOffset

        public float getCoordAtOffset​(int offset)
        Parameters:
        offset - UTF-16 character offset
        Returns:
        glyph coordinate
      • getIntercepts

        @Nullable
        public @org.jetbrains.annotations.Nullable float[] getIntercepts​(float lowerBound,
                                                                         float upperBound)

        Returns the number of intervals that intersect bounds. bounds describes a pair of lines parallel to the text advance. The return array size is a multiple of two, and is at most twice the number of glyphs in the the blob.

        Parameters:
        lowerBound - lower line parallel to the advance
        upperBound - upper line parallel to the advance
        Returns:
        intersections; may be null
      • getIntercepts

        @Nullable
        public @org.jetbrains.annotations.Nullable float[] getIntercepts​(float lowerBound,
                                                                         float upperBound,
                                                                         @Nullable
                                                                         @Nullable Paint paint)

        Returns the number of intervals that intersect bounds. bounds describes a pair of lines parallel to the text advance. The return array size is a multiple of two, and is at most twice the number of glyphs in the the blob.

        Parameters:
        lowerBound - lower line parallel to the advance
        upperBound - upper line parallel to the advance
        paint - specifies stroking, PathEffect that affects the result; may be null
        Returns:
        intersections; may be null
      • _nGetFinalizer

        @Internal
        public static long _nGetFinalizer()
      • _nGetAscent

        @Internal
        public static float _nGetAscent​(long ptr)
      • _nGetCapHeight

        @Internal
        public static float _nGetCapHeight​(long ptr)
      • _nGetXHeight

        @Internal
        public static float _nGetXHeight​(long ptr)
      • _nGetDescent

        @Internal
        public static float _nGetDescent​(long ptr)
      • _nGetLeading

        @Internal
        public static float _nGetLeading​(long ptr)
      • _nGetWidth

        @Internal
        public static float _nGetWidth​(long ptr)
      • _nGetHeight

        @Internal
        public static float _nGetHeight​(long ptr)
      • _nGetTextBlob

        @Internal
        public static long _nGetTextBlob​(long ptr)
      • _nGetGlyphs

        @Internal
        public static short[] _nGetGlyphs​(long ptr)
      • _nGetPositions

        @Internal
        public static float[] _nGetPositions​(long ptr)
      • _nGetRunPositions

        @Internal
        public static float[] _nGetRunPositions​(long ptr)
      • _nGetBreakPositions

        @Internal
        public static float[] _nGetBreakPositions​(long ptr)
      • _nGetBreakOffsets

        @Internal
        public static int[] _nGetBreakOffsets​(long ptr)
      • _nGetOffsetAtCoord

        @Internal
        public static int _nGetOffsetAtCoord​(long ptr,
                                             float x)
      • _nGetLeftOffsetAtCoord

        @Internal
        public static int _nGetLeftOffsetAtCoord​(long ptr,
                                                 float x)
      • _nGetCoordAtOffset

        @Internal
        public static float _nGetCoordAtOffset​(long ptr,
                                               int offset)