diniamo
04/07/2021, 7:58 AM@font-face {
-fx-font-family: "Poppins", poppins;
-fx-font-weight: bold;
src: url('../font/Poppins-Bold.ttf');
}
@font-face {
-fx-font-family: "Poppins", poppins;
-fx-font-weight: medium;
src: url('../font/Poppins-Medium.ttf');
}
@font-face {
-fx-font-family: "Poppins", poppins;
-fx-font-weight: medium;
-fx-font-style: italic;
src: url('../font/Poppins-MediumItalic.ttf');
}
But when I tried to apply them it doesn't work. I mostly use medium and when I try to set the font-weight, on a label let's say I get this error:
main-view.css: Expected '<font-weight>' while parsing '-fx-font-weight' at [13,21]
I have found some StackOverflow questions, but none of the answers seem to have helped.Vladimir N.
04/08/2021, 11:48 AMdiniamo
04/08/2021, 12:32 PMVladimir N.
04/08/2021, 1:01 PMdiniamo
04/08/2021, 1:02 PMVladimir N.
04/08/2021, 1:02 PMVladimir N.
04/08/2021, 1:03 PMdiniamo
04/08/2021, 1:34 PMVladimir N.
04/08/2021, 1:35 PMdiniamo
04/08/2021, 1:36 PMVladimir N.
04/08/2021, 1:37 PMdiniamo
04/08/2021, 1:47 PMVladimir N.
04/08/2021, 1:48 PMmedium
to 500
?Vladimir N.
04/08/2021, 1:49 PM@font-face {
-fx-font-family: "Poppins", poppins;
-fx-font-weight: 500;
-fx-font-style: italic;
src: url('../font/Poppins-MediumItalic.ttf');
}
diniamo
04/08/2021, 1:50 PMdiniamo
04/08/2021, 1:50 PMdiniamo
04/08/2021, 3:11 PMdiniamo
04/09/2021, 6:31 AMSamkeene
04/09/2021, 1:55 PMSamkeene
04/09/2021, 2:03 PMdiniamo
04/09/2021, 2:44 PMSamkeene
04/09/2021, 2:46 PMSamkeene
04/09/2021, 2:48 PMdiniamo
04/09/2021, 4:28 PMdiniamo
04/09/2021, 4:50 PMdiniamo
04/09/2021, 4:51 PMSamkeene
04/09/2021, 5:29 PMdiniamo
04/09/2021, 6:03 PMSamkeene
04/09/2021, 6:39 PMSamkeene
04/09/2021, 7:06 PM@font-face
declarations into the main-view.css
- this isn't ideal, maybe its a quirk of javafx css that I am not aware..diniamo
04/09/2021, 7:09 PMdiniamo
04/09/2021, 7:09 PMSamkeene
04/09/2021, 7:33 PMloadFont
also worksSamkeene
04/09/2021, 7:48 PMSamkeene
04/09/2021, 7:48 PMSamkeene
04/09/2021, 7:49 PMfont-face
declarations need to be the first thing in the css file, you have a root
declaration above them. Move that under and it all works.diniamo
04/09/2021, 8:03 PMdiniamo
04/09/2021, 8:12 PM