Enum FontPitch
- java.lang.Object
-
- java.lang.Enum<FontPitch>
-
- org.apache.poi.common.usermodel.fonts.FontPitch
-
- All Implemented Interfaces:
Serializable
,Comparable<FontPitch>
public enum FontPitch extends Enum<FontPitch>
A property of a font that describes the pitch, of the characters.- Since:
- POI 3.17-beta2
-
-
Enum Constant Summary
Enum Constants Enum Constant 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getNativeId()
static byte
getNativeId(FontPitch pitch, FontFamily family)
Combine pitch and family to native idstatic FontPitch
valueOf(int flag)
Returns the enum constant of this type with the specified name.static FontPitch
valueOf(String name)
Returns the enum constant of this type with the specified name.static FontPitch
valueOfPitchFamily(byte pitchAndFamily)
Get FontPitch from native idstatic FontPitch[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DEFAULT
public static final FontPitch DEFAULT
The default pitch, which is implementation-dependent.
-
FIXED
public static final FontPitch FIXED
A fixed pitch, which means that all the characters in the font occupy the same width when output in a string.
-
VARIABLE
public static final FontPitch 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. For example, the "i" and space characters usually have much smaller widths than a "W" or "O" character.
-
-
Method Detail
-
values
public static FontPitch[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FontPitch c : FontPitch.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FontPitch valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getNativeId
public int getNativeId()
-
valueOf
public static FontPitch valueOf(int flag)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
flag
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getNativeId
public static byte getNativeId(FontPitch pitch, FontFamily family)
Combine pitch and family to native id- Parameters:
pitch
- The pitch-value, cannot be nullfamily
- The family-value, cannot be null- Returns:
- The resulting combined byte-value with pitch and family encoded into one byte
- See Also:
- LOGFONT structure
-
valueOfPitchFamily
public static FontPitch valueOfPitchFamily(byte pitchAndFamily)
Get FontPitch from native id- Parameters:
pitchAndFamily
- The combined byte value for pitch and family- Returns:
- The resulting FontPitch enumeration value
-
-