问题
我正在为我的应用程序创建一个超级马里奥主题的CSS样式表,并且想要更改按钮的字体为名为Press Start 2P的自定义字体,这是NES马里奥游戏中使用的像素化字体。但是,由于某种奇怪的原因,我的应用程序无法加载此字体。
CSS代码:
.text
{
-fx-font-family: "Press-Start-2P";
}
.button
{
-fx-background-color: transparent;
//-fx-text-fill: rgb(255, 255, 255);
}
@font-face
{
font-family: Press-Start-2P;
src: url("PressStart2P.ttf");
}
当我运行应用程序时,它会给我这个消息:
如何使我的应用程序正确加载字体?2015年4月25日上午8:22:32 com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged INFO: 无法加载@font-face字体 [file:/C:/Users/Ahmad%20El-Baher/Documents/Programming/Java/Integrative%20Project%20Semester%204/trunk/build/classes/res/styles/PressStart2P.ttf]