Package javafx.scene.text
Class Font
java.lang.Object
javafx.scene.text.Font
- Author:
- Bruno Salmon
-
Constructor Summary
ConstructorDescriptionFont
(double size) Constructs a font using the default face "System".Constructs a font using the specified full face name and sizeFont
(String name, String family, FontWeight weight, FontPosture posture, double size) Font
(String family, FontWeight weight, FontPosture posture, double size) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static Font
font
(double size) static Font
Searches for an appropriate font based on the given font family name and default font size.static Font
static Font
font
(String family, FontPosture posture, double size) static Font
font
(String family, FontWeight weight, double size) static Font
font
(String family, FontWeight weight, FontPosture posture, double size) double
static Font
Gets the default font which will be from the family "System", and typically the style "Regular", and be of a size consistent with the user's desktop environment, to the extent that can be determined.static ObservableList<Font>
getName()
static ObservableList<Font>
double
getSize()
getUrl()
int
hashCode()
boolean
static Font
void
setBaselineOffset
(double baselineOffset)
-
Constructor Details
-
Font
public Font(double size) Constructs a font using the default face "System". The underlying font used is determined by the implementation based on the typical UI font for the current UI environment.- Parameters:
size
- the font size to use
-
Font
Constructs a font using the specified full face name and size- Parameters:
name
- full name of the font.size
- the font size to use
-
Font
-
Font
-
-
Method Details
-
font
Searches for an appropriate font based on the given font family name and default font size. This method is not guaranteed to return a specific font, but does its best to find one that fits the specified requirements. A null or empty value for family allows the implementation to select any suitable font.- Parameters:
family
- The family of the font- Returns:
- The font that best fits the specified requirements.
-
getName
-
getFamily
-
getWeight
-
getPosture
-
getSize
public double getSize() -
getUrl
-
isBaselineOffsetSet
public boolean isBaselineOffsetSet() -
getBaselineOffset
public double getBaselineOffset() -
setBaselineOffset
public void setBaselineOffset(double baselineOffset) -
font
-
font
-
font
-
font
-
font
-
getDefault
Gets the default font which will be from the family "System", and typically the style "Regular", and be of a size consistent with the user's desktop environment, to the extent that can be determined.- Returns:
- The default font.
-
loadFont
-
equals
-
hashCode
public int hashCode() -
getRequestedFonts
-
getLoadingFonts
-