JFXtrasFontRoboto.loadAll();
text.setStyle("-fx-font-family: '" + JFXtrasFontRoboto.AvailableFonts.RobotoMedium.getFamilyName() + "';");
}
public class JFXtrasFontRoboto
extends java.lang.Object
This class loads Google’s Roboto font and make it available in CSS files and style properties. You can load all available fonts or individual fonts. The to-be-used family name for -fx-font-family (between quotes) is available as a property on the AvailableFonts.
Example
JFXtrasFontRoboto.loadAll();
text.setStyle("-fx-font-family: '" + JFXtrasFontRoboto.AvailableFonts.RobotoMedium.getFamilyName() + "';");
}
.label {
-fx-font-family: 'Roboto Light';
}
Modifier and Type | Class and Description |
---|---|
static class |
JFXtrasFontRoboto.AvailableFonts |
Constructor and Description |
---|
JFXtrasFontRoboto() |
Modifier and Type | Method and Description |
---|---|
static void |
load(JFXtrasFontRoboto.AvailableFonts font)
Load a single font (if not already loaded)
|
static void |
loadAll()
Load all available fonts
|
public static void loadAll()
Load all available fonts
public static void load(JFXtrasFontRoboto.AvailableFonts font)
Load a single font (if not already loaded)
font
-