Guido
Guido

Reputation: 958

Font families available in JavaFX 8

In my JavaFX application, the user will have the possibility to choose the font or font family for displaying the menus, labels, combo boxes, check boxes etc. Where can I find the different font families available for JavaFX 8?

Upvotes: 18

Views: 54165

Answers (2)

Ugurcan Yildirim
Ugurcan Yildirim

Reputation: 6132

You can get the list of installed font families by calling javafx.scene.text.Font.getFamilies();.

Upvotes: 31

jbanks
jbanks

Reputation: 193

Personally I would attach a CSS sheet to your program, in that case you can set the default font family using .root, something like this;

    .root{
    -fx-font-family: "Courier New";
}

Here are some examples of some websafe fonts you could use in CSS;

http://www.webdesigndev.com/16-gorgeous-web-safe-fonts-to-use-with-css/

And:

http://www.w3schools.com/cssref/css_websafe_fonts.asp

Upvotes: 5

Related Questions