文本以难以理解的字体显示
当我运行该程序时,这些单词以难以理解的字母和字体书写。我尝试使用:scene.getRoot().setStyle("-fx-font-family: 'serif'"); 但它没有帮助
CoreText 注意:客户端请求名称“.SFNS-Regular”,它将获得 Times-Roman 而不是预期的字体。所有系统 UI 字体访问都应通过适当的 API,例如 CTFontCreateUIFontForLanguage() 或 +[NSFont systemFontOfSize:]
public class Main extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(Main.class.getResource("mainwindow.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 900, 500);
stage.setTitle("Todo List");
scene.getRoot().setStyle("-fx-font-family: 'serif'");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
@Override
public void stop() throws Exception {
try {
TodoData.getInstance().storeTodoItems();
} catch (IOException e) {
System.out.println(e.getMessage());
}
}
@Override
public void init() throws Exception {
try {
TodoData.getInstance().loadTdoItems();
} catch (IOException e) {
System.out.println(e.getMessage());
}
}
}
以下是难以理解的字体的示例:
When I run the program, the words are written in incomprehensible letters and font. I tried to use: scene.getRoot().setStyle("-fx-font-family: 'serif'");
but it didn't help
CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:]
public class Main extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(Main.class.getResource("mainwindow.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 900, 500);
stage.setTitle("Todo List");
scene.getRoot().setStyle("-fx-font-family: 'serif'");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
@Override
public void stop() throws Exception {
try {
TodoData.getInstance().storeTodoItems();
} catch (IOException e) {
System.out.println(e.getMessage());
}
}
@Override
public void init() throws Exception {
try {
TodoData.getInstance().loadTdoItems();
} catch (IOException e) {
System.out.println(e.getMessage());
}
}
}
Here is an example of the incomprehensible font:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论