Package io.github.humbleui.skija
Class TextLine
- java.lang.Object
-
- io.github.humbleui.skija.impl.Native
-
- io.github.humbleui.skija.impl.Managed
-
- io.github.humbleui.skija.TextLine
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class TextLine extends Managed
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTextLine._FinalizerHolder-
Nested classes/interfaces inherited from class io.github.humbleui.skija.impl.Managed
Managed.CleanerThunk
-
-
Field Summary
-
Fields inherited from class io.github.humbleui.skija.impl.Managed
_cleanable
-
-
Constructor Summary
Constructors Constructor Description TextLine(long ptr)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static float_nGetAscent(long ptr)static int[]_nGetBreakOffsets(long ptr)static float[]_nGetBreakPositions(long ptr)static float_nGetCapHeight(long ptr)static float_nGetCoordAtOffset(long ptr, int offset)static float_nGetDescent(long ptr)static long_nGetFinalizer()static short[]_nGetGlyphs(long ptr)static float_nGetHeight(long ptr)static float_nGetLeading(long ptr)static int_nGetLeftOffsetAtCoord(long ptr, float x)static int_nGetOffsetAtCoord(long ptr, float x)static float[]_nGetPositions(long ptr)static float[]_nGetRunPositions(long ptr)static long_nGetTextBlob(long ptr)static float_nGetWidth(long ptr)static float_nGetXHeight(long ptr)floatgetAscent()floatgetCapHeight()floatgetCoordAtOffset(int offset)floatgetDescent()short[]getGlyphs()floatgetHeight()@org.jetbrains.annotations.Nullable float[]getIntercepts(float lowerBound, float upperBound)Returns the number of intervals that intersect bounds.@org.jetbrains.annotations.Nullable float[]getIntercepts(float lowerBound, float upperBound, @Nullable Paint paint)Returns the number of intervals that intersect bounds.floatgetLeading()intgetLeftOffsetAtCoord(float x)intgetOffsetAtCoord(float x)float[]getPositions()@Nullable TextBlobgetTextBlob()floatgetWidth()floatgetXHeight()static @NotNull TextLinemake(java.lang.String text, Font font)static @NotNull TextLinemake(java.lang.String text, Font font, ShapingOptions opts)-
Methods inherited from class io.github.humbleui.skija.impl.Managed
_nInvokeFinalizer, close, isClosed
-
-
-
-
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 advanceupperBound- 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 advanceupperBound- upper line parallel to the advancepaint- 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)
-
-