javafx - How can I attach a custom font in scene builder using CSS? -


so have multiple '.ttf' fonts in folder buy i'm failing use them in scene builder using fxml , css.

here's i've tried label called 'serial connection' attached css file theses lines:

.serialconn {     -fx-font-family:url("fonts/capsuula.ttf"); } 

that's similar i'm using set backgrounds doesn't work fonts.

this should work java versions < 1.8u60 :

@font-face {     font-family: 'capsuula';     src: url('fonts/capsuula.ttf'); }  .serialconn {     -fx-font-family: 'capsuula'; } 

note :

make sure value of -fx-font-family (capsuula in code example) actual name of font found inside capsuula.ttf.

for more info, can go how integrate custom fonts in javafx application using css


Comments