Skip to content

Commit

Permalink
更新 HelloController.java
Browse files Browse the repository at this point in the history
调整主界面的 tm.addScene(scene);的时机尝试解决自带字体不生效的问题
  • Loading branch information
iammmmmmm authored Oct 24, 2024
1 parent f14afae commit 15aa99f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/caidanci/HelloController.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,12 @@ private boolean checkWord(String word) {
*/
@FXML
void initialize() {

Font a = Font.loadFont(Objects.requireNonNull(this.getClass().getResourceAsStream("fonts/fzjt.ttf")), 0);
Platform.runLater(() -> tm.setFontFamily(a.getFamily()));
tools.makeFontFamilyChooser(fontChose);
Platform.runLater(() -> tm.setFontFamily(a.getFamily()));
Platform.runLater(() -> tm.addScene(info.getScence()));

tools.makeFontFamilyChooser(fontChose);
tools.makeFontSizeChooser(fontSize);
Platform.runLater(() -> Application.setUserAgentStylesheet(theme[themeFlag]));
changeTheme.setGraphic(new FontIcon(BootstrapIcons.MOON));
Expand Down

0 comments on commit 15aa99f

Please sign in to comment.