When I make javafx load a font with a code like this:
font = Font.loadFont(getClass().getClassLoader().getResource("gui/font.ttf").toExternalForm(), 25);
and, after it has successfully loaded, apply it to a Text
text.setFont(font);
the text shows the right font BUT, when I try to apply to it some styles or weights like
text.setStyle("-fx-font-weight: bold;");
or
text.setStyle("-fx-font-style: italic;");
Nothing changes. I've tried this even with the SceneBuilder and It doesn't work there too. What can I do to make java load my font WITH all the styles and weights (or, at least, make it try to derive them)?
EDIT: fount used: Peque Script (I know, 5 minutes ago it wasn't in maintenance) Some other fonts found online like this or this