de.jensd.fx.glyphs.fontawesome.demo.FontTestFX Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fontawesomefx-fontawesome Show documentation
Show all versions of fontawesomefx-fontawesome Show documentation
Provide WebFont Icons for JavaFX Apps
The newest version!
package de.jensd.fx.glyphs.fontawesome.demo;
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.text.Font;
import javafx.stage.Stage;
public class FontTestFX extends Application {
private void loadFont(String fileName) {
try {
FileInputStream fontFile = new FileInputStream(new File(fileName));
Font.loadFont(fontFile, 16);
} catch (FileNotFoundException ex) {
}
}
@Override
public void start(Stage primaryStage) {
String fileName = FontAwesomeIconView.TTF_PATH;
loadFont(fileName);
loadFont(fileName);
Platform.exit();
}
public static void main(String[] args) {
launch(args);
}
}