Enum Constant and Description |
---|
DEFAULT
The default pitch, which is implementation-dependent.
|
FIXED
A fixed pitch, which means that all the characters in the font occupy the same width when output in a string.
|
VARIABLE
A variable pitch, which means that the characters in the font occupy widths that are proportional to the actual widths of the glyphs when output in a string.
|
Modifier and Type | Method and Description |
---|---|
int |
getNativeId() |
static byte |
getNativeId(FontPitch pitch, FontFamily family)
Combine pitch and family to native id
(将音高和家庭与本地 ID 结合起来)
|
static FontPitch |
valueOf(int flag) |
static FontPitch |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
(返回具有指定名称的此类型的枚举常量。)
|
static FontPitch |
valueOfPitchFamily(byte pitchAndFamily)
Get FontPitch from native id
(从本机 id 获取 FontPitch)
|
static FontPitch[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared.
(按照声明的顺序返回包含此枚举类型常量的数组。)
|
public static final FontPitch DEFAULT
public static final FontPitch FIXED
public static final FontPitch VARIABLE
public static FontPitch[] values()
for (FontPitch c : FontPitch.values()) System.out.println(c);(按照声明的顺序返回包含此枚举类型常量的数组。此方法可用于迭代常量,如下所示: for (FontPitch c : FontPitch.values()) System.out.println(c);)
public static FontPitch valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
(name - 要返回的枚举常量的名称。)
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified name
(java.lang.IllegalArgumentException - 如果此枚举类型没有具有指定名称的常量)
java.lang.NullPointerException
- if the argument is null
(java.lang.NullPointerException - 如果参数为空)
public int getNativeId()
public static FontPitch valueOf(int flag)
public static byte getNativeId(FontPitch pitch, FontFamily family)
pitch
- The pitch-value, cannot be null
(pitch - 音高值,不能为空)
family
- The family-value, cannot be null
(family - 家庭值,不能为空)
public static FontPitch valueOfPitchFamily(byte pitchAndFamily)
pitchAndFamily
- The combined byte value for pitch and family
(pitchAndFamily - pitch 和 family 的组合字节值)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.