Serializable, Comparable<TextLayout.FontPaddingStrategy>public static enum TextLayout.FontPaddingStrategy extends Enum<TextLayout.FontPaddingStrategy>
Font padding is the space between the ascent and top, or between the descent and bottom. Font designers don't guarantee that all glyphs are constrained between ascent and decent, so using padding can guarantee that the upper and lower edges of the text are not clipped.
| 枚举常量 | 说明 |
|---|---|
EVERY_LINE |
Indicates that padding is added to every line.
|
NONE |
Indicates no padding.
|
ONLY_FIRST_AND_LAST_LINE |
Indicates that padding is added only to the first line and the last line.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static TextLayout.FontPaddingStrategy |
getByInt(int enumInt) |
Obtains the enumeration object according to the value.
|
int |
getValue() |
Obtains the value of the FontPaddingStrategy type.
|
static TextLayout.FontPaddingStrategy |
valueOf(String name) |
返回带有指定名称的该类型的枚举常量。
字符串必须与用于声明该类型的枚举常量的
标识符完全匹配。(不允许有多余
的空格字符。)
|
static TextLayout.FontPaddingStrategy[] |
values() |
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。该方法可用于迭代
常量, 如下所示:
for (TextLayout.FontPaddingStrategy c : TextLayout.FontPaddingStrategy.values()) System.out.println(c); |
public static final TextLayout.FontPaddingStrategy ONLY_FIRST_AND_LAST_LINE
public static final TextLayout.FontPaddingStrategy EVERY_LINE
public static final TextLayout.FontPaddingStrategy NONE
public static TextLayout.FontPaddingStrategy[] values()
for (TextLayout.FontPaddingStrategy c : TextLayout.FontPaddingStrategy.values()) System.out.println(c);
public static TextLayout.FontPaddingStrategy valueOf(String name)
name - 要返回的枚举常量的名称。IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量NullPointerException - 如果参数为空值public int getValue()
public static TextLayout.FontPaddingStrategy getByInt(int enumInt)
enumInt - Indicates the enumeration value of the indicator.enumInt value.