Skip to content

Commit fad3403

Browse files
committed
使Windows上的字体渲染更加清晰
1 parent db6e010 commit fad3403

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/main/java/com/icuxika/MainApp.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ public void start(Stage primaryStage) throws Exception {
4444
vBox.setSpacing(10);
4545
vBox.getChildren().addAll(label, zhButton, enButton);
4646

47+
Scene scene = new Scene(vBox, 600, 400);
48+
if (System.getProperty("os.name").toLowerCase().contains("win")) {
49+
scene.getStylesheets().add(AppResource.load("css/application-win-fix.css").toExternalForm());
50+
}
4751
primaryStage.titleProperty().bind(AppResource.getLanguageBinding("title"));
48-
primaryStage.setScene(new Scene(vBox, 600, 400));
52+
primaryStage.setScene(scene);
4953
primaryStage.show();
5054
}
5155

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.text {
2+
-fx-font-smoothing-type: gray;
3+
}

0 commit comments

Comments
 (0)