Is it possible to specify a font using CSS in JavaFX application? I have an FXML scene and the corresponding CSS file. In Java code, it\'s possible to specify a font using t
Another way is to load font using FileIUnputStream, thus you don't need to use css:
@FXML
private Label myLabel;
@Override
public void initialize(URL arg0, ResourceBundle arg1){
Font myFont = null;
try {
myFont = Font.loadFont(new FileInputStream(new File("patch_to_font.ttf")), 10);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
myLabel.setFont(myFont);
}