public interface RichTextString
Modifier and Type | Method and Description |
---|---|
void |
applyFont(Font font)
Sets the font of the entire string.
(设置整个字符串的字体。)
|
void |
applyFont(int startIndex, int endIndex, Font font)
Applies a font to the specified characters of a string.
(将字体应用于字符串的指定字符。)
|
void |
applyFont(int startIndex, int endIndex, short fontIndex)
Applies a font to the specified characters of a string.
(将字体应用于字符串的指定字符。)
|
void |
applyFont(short fontIndex)
Applies the specified font to the entire string.
(将指定的字体应用于整个字符串。)
|
void |
clearFormatting()
Removes any formatting that may have been applied to the string.
(删除可能已应用于字符串的任何格式。)
|
int |
getIndexOfFormattingRun(int index)
The index within the string to which the specified formatting run applies.
(指定格式运行应用到的字符串中的索引。)
|
java.lang.String |
getString()
Returns the plain string representation.
(返回纯字符串表示。)
|
int |
length() |
int |
numFormattingRuns() |
void applyFont(int startIndex, int endIndex, short fontIndex)
startIndex
- The start index to apply the font to (inclusive)
(startIndex - 应用字体的起始索引(包括))
endIndex
- The end index to apply the font to (exclusive)
(endIndex - 应用字体的结束索引(不包括))
fontIndex
- The font to use.
(fontIndex - 要使用的字体。)
void applyFont(int startIndex, int endIndex, Font font)
startIndex
- The start index to apply the font to (inclusive)
(startIndex - 应用字体的起始索引(包括))
endIndex
- The end index to apply to font to (exclusive)
(endIndex - 应用于字体的结束索引(不包括))
font
- The index of the font to use.
(font - 要使用的字体的索引。)
void applyFont(Font font)
font
- The font to use.
(font - 要使用的字体。)
void clearFormatting()
java.lang.String getString()
int length()
int numFormattingRuns()
int getIndexOfFormattingRun(int index)
index
- the index of the formatting run
(index - 格式化运行的索引)
void applyFont(short fontIndex)
fontIndex
- the font to apply.
(fontIndex - 要应用的字体。)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.