public class PrismTextLayout extends Object implements TextLayout
ALIGN_CENTER, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_MASK, ALIGN_RIGHT, ANALYSIS_MASK, BOUNDS_CENTER, BOUNDS_MASK, DIRECTION_DEFAULT_LTR, DIRECTION_DEFAULT_RTL, DIRECTION_LTR, DIRECTION_MASK, DIRECTION_RTL, FLAGS_ANALYSIS_VALID, FLAGS_CACHED_STRIKETHROUGH, FLAGS_CACHED_UNDERLINE, FLAGS_HAS_BIDI, FLAGS_HAS_CJK, FLAGS_HAS_COMPLEX, FLAGS_HAS_EMBEDDED, FLAGS_HAS_TABS, FLAGS_LAST, FLAGS_LINES_VALID, FLAGS_RTL_BASE, FLAGS_WRAPPED, TYPE_BASELINE, TYPE_BEARINGS, TYPE_STRIKETHROUGH, TYPE_TEXT, TYPE_TOP, TYPE_UNDERLINE| Constructor and Description |
|---|
PrismTextLayout() |
| Modifier and Type | Method and Description |
|---|---|
void |
addTextRun(TextRun run) |
BaseBounds |
getBounds()
Returns the (logical) bounds of the layout
minX is always zero
minY is the ascent of the first line (negative)
width the width of the widest line
height the sum of all lines height
Note that this width is different the wrapping width!
|
BaseBounds |
getBounds(TextSpan filter,
BaseBounds bounds) |
PathElement[] |
getCaretShape(int offset,
boolean isLeading,
float x,
float y) |
int |
getDirection() |
PGFont |
getFont() |
HitInfo |
getHitInfo(float x,
float y) |
TextLine[] |
getLines()
Returns the lines of text layout.
|
PathElement[] |
getRange(int start,
int end,
int type,
float x,
float y) |
GlyphList[] |
getRuns()
Returns the GlyphList of text layout.
|
Shape |
getShape(int type,
TextSpan filter)
Returns the shape of the entire text layout relative to the baseline
of the first line.
|
TextSpan[] |
getTextSpans() |
BaseBounds |
getVisualBounds(int type)
Returns the visual bounds of the layout using glyph bounding box
|
boolean |
setAlignment(int alignment)
Sets the alignment for the TextLayout.
|
boolean |
setBoundsType(int type)
Sets the bounds type for the TextLayout.
|
boolean |
setContent(String text,
Object font)
Sets the content for the TextLayout.
|
boolean |
setContent(TextSpan[] spans)
*
TextLayout API *
*
|
boolean |
setDirection(int direction)
Sets the direction (bidi algorithm's) for the TextLayout.
|
boolean |
setLineSpacing(float spacing)
Sets the line spacing for the TextLayout.
|
boolean |
setWrapWidth(float newWidth)
Sets the wrap width for the TextLayout.
|
public boolean setContent(TextSpan[] spans)
setContent in interface TextLayoutpublic boolean setContent(String text, Object font)
TextLayoutsetContent in interface TextLayoutpublic boolean setDirection(int direction)
TextLayoutsetDirection in interface TextLayoutpublic boolean setBoundsType(int type)
TextLayoutsetBoundsType in interface TextLayoutpublic boolean setAlignment(int alignment)
TextLayoutsetAlignment in interface TextLayoutpublic boolean setWrapWidth(float newWidth)
TextLayoutsetWrapWidth in interface TextLayoutpublic boolean setLineSpacing(float spacing)
TextLayoutsetLineSpacing in interface TextLayoutpublic TextLine[] getLines()
TextLayoutgetLines in interface TextLayoutpublic GlyphList[] getRuns()
TextLayoutgetRuns in interface TextLayoutpublic BaseBounds getBounds()
TextLayoutgetBounds in interface TextLayoutpublic BaseBounds getBounds(TextSpan filter, BaseBounds bounds)
getBounds in interface TextLayoutpublic PathElement[] getCaretShape(int offset, boolean isLeading, float x, float y)
getCaretShape in interface TextLayoutpublic HitInfo getHitInfo(float x, float y)
getHitInfo in interface TextLayoutpublic PathElement[] getRange(int start, int end, int type, float x, float y)
getRange in interface TextLayoutpublic Shape getShape(int type, TextSpan filter)
TextLayoutgetShape in interface TextLayouttype - the type of the shapes to includepublic TextSpan[] getTextSpans()
public PGFont getFont()
public int getDirection()
public void addTextRun(TextRun run)
public BaseBounds getVisualBounds(int type)
TextLayoutgetVisualBounds in interface TextLayoutCopyright © 2025. All rights reserved.