- All Implemented Interfaces:
- Serializable,- Comparable<FontWeight>,- Constable
public enum FontWeight extends Enum<FontWeight>
Specifies different font weights which can be used when searching for a
 font on the system.
 The names correspond to pre-defined weights in the OS/2 table of the
 
 OpenType font specification.
 The CSS 3 specification references the same as a sequence of values.
- Since:
- JavaFX 2.0
- 
Nested Class SummaryNested classes/interfaces declared in class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum Constants Enum Constant Description BLACKrepresents Black font weight (900).BOLDrepresents Bold font weight (700).EXTRA_BOLDrepresents 'Extra Bold' font weight (800).EXTRA_LIGHTrepresents 'Extra Light' font weight (200).LIGHTrepresents Light font weight (300).MEDIUMrepresents Medium font weight (500).NORMALrepresents Normal font weight (400).SEMI_BOLDrepresents 'Demi Bold' font weight (600).THINrepresents Thin font weight (100).
- 
Method SummaryModifier and Type Method Description static FontWeightfindByName(String name)ReturnsFontWeightby its name.static FontWeightfindByWeight(int weight)Returns the closestFontWeightfor a weight value as defined by the CSS and OpenType specifications.intgetWeight()Return the visual weight (degree of blackness or thickness) specified by thisFontWeight.static FontWeightvalueOf(String name)Returns the enum constant of this type with the specified name.static FontWeight[]values()Returns an array containing the constants of this enum type, in the order they are declared.
- 
Enum Constant Details- 
THINrepresents Thin font weight (100).
- 
EXTRA_LIGHTrepresents 'Extra Light' font weight (200).
- 
LIGHTrepresents Light font weight (300).
- 
NORMALrepresents Normal font weight (400).
- 
MEDIUMrepresents Medium font weight (500).
- 
SEMI_BOLDrepresents 'Demi Bold' font weight (600).
- 
BOLDrepresents Bold font weight (700).
- 
EXTRA_BOLDrepresents 'Extra Bold' font weight (800).
- 
BLACKrepresents Black font weight (900).
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
 
- 
valueOfReturns 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 name
- NullPointerException- if the argument is null
 
- 
getWeightpublic int getWeight()Return the visual weight (degree of blackness or thickness) specified by thisFontWeight.- Returns:
- weight
 
- 
findByNameReturnsFontWeightby its name.- Parameters:
- name- name of the- FontWeight
- Returns:
- the FontWeight by its name
 
- 
findByWeightReturns the closestFontWeightfor a weight value as defined by the CSS and OpenType specifications. Where the specified value is equidistant between twoFontWeightvalues, then the implementation may select either at its discretion. This lookup is without reference to a font, so this is purely a mapping to the set ofFontWeightinstances and does not mean that a font of that weight will be available.- Parameters:
- weight- the weight value
- Returns:
- closest FontWeight
 
 
-