Skip to content

Commit 01a853d

Browse files
AustinShalitJLLeitschuh
authored andcommitted
Fix font loading bug (#590)
1 parent 7aaba49 commit 01a853d

File tree

3 files changed

+7
-28
lines changed

3 files changed

+7
-28
lines changed

ui/src/main/java/edu/wpi/grip/ui/Main.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import javafx.scene.Parent;
2424
import javafx.scene.Scene;
2525
import javafx.scene.image.Image;
26+
import javafx.scene.text.Font;
2627
import javafx.stage.Stage;
2728

2829
import javax.inject.Inject;
@@ -72,6 +73,12 @@ public void start(Stage stage) throws Exception {
7273
injector = Guice.createInjector(Modules.override(new GRIPCoreModule(), new GRIPNetworkModule(), new GRIPSourcesHardwareModule()).with(new GRIPUIModule()));
7374
injector.injectMembers(this);
7475

76+
System.setProperty("prism.lcdtext", "false");
77+
Font.loadFont(this.getClass().getResource("roboto/Roboto-Regular.ttf").openStream(), -1);
78+
Font.loadFont(this.getClass().getResource("roboto/Roboto-Bold.ttf").openStream(), -1);
79+
Font.loadFont(this.getClass().getResource("roboto/Roboto-Italic.ttf").openStream(), -1);
80+
Font.loadFont(this.getClass().getResource("roboto/Roboto-BoldItalic.ttf").openStream(), -1);
81+
7582
root = FXMLLoader.load(Main.class.getResource("MainWindow.fxml"), null, null, injector::getInstance);
7683
root.setStyle("-fx-font-size: " + DPIUtility.FONT_SIZE + "px");
7784

ui/src/main/resources/edu/wpi/grip/ui/MainWindow.fxml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@
150150
<fx:include source="Deploy.fxml" fx:id="deployPane"/>
151151
</fx:define>
152152
<stylesheets>
153-
<URL value="@roboto/Roboto.css"/>
154153
<URL value="@GRIP.css"/>
155154
</stylesheets>
156155
</VBox>

ui/src/main/resources/edu/wpi/grip/ui/roboto/Roboto.css

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)