Rectangles showed up when using FXML
<Button fx:id="iconWeb" style="-fx-font-size: 16.0;" onAction="#load" > <graphic> <FontAwesomeIconView glyphName="CLOUD"/> </graphic> </Button>
Using FXML will show up Rectangles. Declared as Code, all is fine. Means this:
GlyphsDude.setIcon(btnNewMail, FontAwesomeIcon.PAPER_PLANE_ALT, "14", ContentDisplay.LEFT);
produces correctly looking icons on the gui.
I have used FXML in Version 8.10.7 which was working fine. Then i have updated to 8.7. Since then i am struggeling. I then tried out back till Version 8.1. With none version it was working anymore.. Idea?
Jdk 1.8.0_66 on Mac OSX 10.10.5
Comments (9)
-
reporter -
repo owner - changed status to open
-
repo owner Timo, would you send me your code so I can try to find the issue?
-
reporter - attached FontAwesome87.zip
Hi. I have created a little demo - see attached zip. Here you will find the rectangle showed up when -fx-font-family is declared in .root.
-
Same issue here... Any thoughts?
-
I had the same issue of rectangles showing up. Looks like it happens when you have any font class css like family or size. As long as I swap the font-size for scale and remove the family it works.
-fx-translate-x: 2px; -fx-scale-x: 1.7; -fx-scale-y: 1.7;
-
You can workaround it by setting
-fx-font-family: FontAwesome;
on the icon
-
Thanks @acasall that worked for me.
-
repo owner - changed status to resolved
Thanks @acasall for resolving ;-)!
- Log in to comment
Ok, found the cause of it: specifying -fx-font-family: 'Arial'; in the css .root. So commenting it out all is working. But of coursce its not possible to declare a font-family.