public interface TextLayout
Modifier and Type | Field and Description |
---|---|
static int |
ALIGN_CENTER |
static int |
ALIGN_JUSTIFY |
static int |
ALIGN_LEFT |
static int |
ALIGN_MASK |
static int |
ALIGN_RIGHT |
static int |
ANALYSIS_MASK |
static int |
BOUNDS_CENTER |
static int |
BOUNDS_MASK |
static int |
DIRECTION_DEFAULT_LTR |
static int |
DIRECTION_DEFAULT_RTL |
static int |
DIRECTION_LTR |
static int |
DIRECTION_MASK |
static int |
DIRECTION_RTL |
static int |
FLAGS_ANALYSIS_VALID |
static int |
FLAGS_CACHED_STRIKETHROUGH |
static int |
FLAGS_CACHED_UNDERLINE |
static int |
FLAGS_HAS_BIDI |
static int |
FLAGS_HAS_CJK |
static int |
FLAGS_HAS_COMPLEX |
static int |
FLAGS_HAS_EMBEDDED |
static int |
FLAGS_HAS_TABS |
static int |
FLAGS_LAST |
static int |
FLAGS_LINES_VALID |
static int |
FLAGS_RTL_BASE |
static int |
FLAGS_WRAPPED |
static int |
TYPE_BASELINE |
static int |
TYPE_BEARINGS |
static int |
TYPE_STRIKETHROUGH |
static int |
TYPE_TEXT |
static int |
TYPE_TOP |
static int |
TYPE_UNDERLINE |
Modifier and Type | Method and Description |
---|---|
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) |
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.
|
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(java.lang.String string,
java.lang.Object font)
Sets the content for the TextLayout.
|
boolean |
setContent(TextSpan[] spans)
Sets the content for the TextLayout.
|
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 wrapWidth)
Sets the wrap width for the TextLayout.
|
static final int FLAGS_LINES_VALID
static final int FLAGS_ANALYSIS_VALID
static final int FLAGS_HAS_TABS
static final int FLAGS_HAS_BIDI
static final int FLAGS_HAS_COMPLEX
static final int FLAGS_HAS_EMBEDDED
static final int FLAGS_HAS_CJK
static final int FLAGS_WRAPPED
static final int FLAGS_RTL_BASE
static final int FLAGS_CACHED_UNDERLINE
static final int FLAGS_CACHED_STRIKETHROUGH
static final int FLAGS_LAST
static final int ANALYSIS_MASK
static final int ALIGN_LEFT
static final int ALIGN_CENTER
static final int ALIGN_RIGHT
static final int ALIGN_JUSTIFY
static final int ALIGN_MASK
static final int DIRECTION_LTR
static final int DIRECTION_RTL
static final int DIRECTION_DEFAULT_LTR
static final int DIRECTION_DEFAULT_RTL
static final int DIRECTION_MASK
static final int BOUNDS_CENTER
static final int BOUNDS_MASK
static final int TYPE_TEXT
static final int TYPE_UNDERLINE
static final int TYPE_STRIKETHROUGH
static final int TYPE_BASELINE
static final int TYPE_TOP
static final int TYPE_BEARINGS
boolean setContent(TextSpan[] spans)
boolean setContent(java.lang.String string, java.lang.Object font)
boolean setAlignment(int alignment)
boolean setWrapWidth(float wrapWidth)
boolean setLineSpacing(float spacing)
boolean setDirection(int direction)
boolean setBoundsType(int type)
BaseBounds getBounds()
BaseBounds getBounds(TextSpan filter, BaseBounds bounds)
BaseBounds getVisualBounds(int type)
TextLine[] getLines()
GlyphList[] getRuns()
Shape getShape(int type, TextSpan filter)
type
- the type of the shapes to includeHitInfo getHitInfo(float x, float y)
PathElement[] getCaretShape(int offset, boolean isLeading, float x, float y)
PathElement[] getRange(int start, int end, int type, float x, float y)