I've successfully loaded .ttf fonts in CSS in my application. When I try to load .ttc for international language support, I get this
Jun 08, 2015 10:12:44 AM com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged
INFO: Could not load @font-face font [file:/E:/DanIDE/out/production/DanIDE/font/tsentsiu-sans-mono-regular.ttc]
So my question is how do I use .ttc in my JavaFX project? Thanks a lot!
Edit: In my CSS I loaded the font like this:
@font-face {
font-family: 'Tsentsiu Sans Mono HC';
src: url('/font/tsentsiu-sans-mono-regular.ttc');
}
@font-face {
font-family: 'Tsentsiu Sans Mono HC Bold';
src: url('/font/tsentsiu-sans-mono-bold.ttc');
}
.code {
-fx-font-family: "Tsentsiu Sans Mono HC";
-fx-fill: green;
}
.variable {
-fx-font-family: 'Tsentsiu Sans Mono HC Bold';
-fx-fill: red;
}
and the RichTextFX
project loaded the CSS for me.
Copy-paste solution from comments:
You have to load font at least once in your code before showing it. Event if you use it in css. Just put load line somewhere in the beginning and it should work.