public enum TextBoundsType extends Enum<TextBoundsType>
Textnodes. The setting affects
boundsInParentThe geometry of text can be measured either in terms of the bounds of the particular text to be rendered - visual bounds, or as properties of the font and the characters to be rendered - logical bounds. Visual bounds are more useful for positioning text as graphics, and for obtaining tight enclosing bounds around the text.
Logical bounds are important for laying out text relative to other text and other components, particularly those which also contain text. The bounds isn't specific to the text being rendered, and so will report heights which account for the potential ascent and descent of text using the font at its specified size. Also leading and trailing spaces are part of the logical advance width of the text.
- JavaFX 2.0
Enum Constant Details
public static final TextBoundsType LOGICALUse logical bounds as the basis for calculating the bounds.
The logical bounds are based on font metrics information. The width is based on the glyph advances and the height on the ascent, descent, and line gap. Except for the last line which does not include the line gap.
Note: This is usually the fastest option.
public static final TextBoundsType VISUALUse visual bounds as the basis for calculating the bounds.
Note: This is likely to be slower than using logical bounds.
public static final TextBoundsType LOGICAL_VERTICAL_CENTERUse logical vertical centered bounds as the basis for calculating the bounds.
This bounds type is typically used to center
Textnodes vertically within the bounds of its parent.
- JavaFX 8.0
public static TextBoundsType values()Returns an array containing the constants of this enum type, in the order they are declared.
- an array containing the constants of this enum type, in the order they are declared
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.)