Top Description Fields Constructors Methods
javafx.scene.text

public final Enum FontWeight

extends Enum<FontWeight>
Class Inheritance

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

Field Summary

Modifier and TypeField and Description
public static final FontWeight
BLACK

represents Black font weight (900).

public static final FontWeight
BOLD

represents Bold font weight (700).

public static final FontWeight
EXTRA_BOLD

represents 'Extra Bold' font weight (800).

public static final FontWeight
EXTRA_LIGHT

represents 'Extra Light' font weight (200).

public static final FontWeight
LIGHT

represents Light font weight (300).

public static final FontWeight
MEDIUM

represents Medium font weight (500).

private final String[]
public static final FontWeight
NORMAL

represents Normal font weight (400).

public static final FontWeight
SEMI_BOLD

represents 'Demi Bold' font weight (600).

public static final FontWeight
THIN

represents Thin font weight (100).

private final int

Constructor Summary

AccessConstructor and Description
private
FontWeight(int weight, String... names)

Method Summary

Modifier and TypeMethod and Description
public static FontWeight

Returns:

the FontWeight by its name
findByName
(String
name of the FontWeight
name
)

Returns FontWeight by its name.

public static FontWeight

Returns:

closest FontWeight
findByWeight
(int
the weight value
weight
)

Returns the closest FontWeight for a weight value as defined by the CSS and OpenType specifications.

public int

Returns:

weight
getWeight
()

Return the visual weight (degree of blackness or thickness) specified by this FontWeight.

public static FontWeight
public static FontWeight[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BLACKback to summary
public static final FontWeight BLACK

represents Black font weight (900).

BOLDback to summary
public static final FontWeight BOLD

represents Bold font weight (700).

EXTRA_BOLDback to summary
public static final FontWeight EXTRA_BOLD

represents 'Extra Bold' font weight (800).

EXTRA_LIGHTback to summary
public static final FontWeight EXTRA_LIGHT

represents 'Extra Light' font weight (200).

LIGHTback to summary
public static final FontWeight LIGHT

represents Light font weight (300).

MEDIUMback to summary
public static final FontWeight MEDIUM

represents Medium font weight (500).

namesback to summary
private final String[] names
NORMALback to summary
public static final FontWeight NORMAL

represents Normal font weight (400).

SEMI_BOLDback to summary
public static final FontWeight SEMI_BOLD

represents 'Demi Bold' font weight (600).

THINback to summary
public static final FontWeight THIN

represents Thin font weight (100).

weightback to summary
private final int weight

Constructor Detail

FontWeightback to summary
private FontWeight(int weight, String... names)

Method Detail

findByNameback to summary
public static FontWeight findByName(String name)

Returns FontWeight by its name.

Parameters
name:String

name of the FontWeight

Returns:FontWeight

the FontWeight by its name

findByWeightback to summary
public static FontWeight findByWeight(int weight)

Returns the closest FontWeight for a weight value as defined by the CSS and OpenType specifications. Where the specified value is equidistant between two FontWeight values, 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 of FontWeight instances and does not mean that a font of that weight will be available.

Parameters
weight:int

the weight value

Returns:FontWeight

closest FontWeight

getWeightback to summary
public int getWeight()

Return the visual weight (degree of blackness or thickness) specified by this FontWeight.

Returns:int

weight

valueOfback to summary
public static FontWeight valueOf(String name)
valuesback to summary
public static FontWeight[] values()