Skip to content

Commit

Permalink
Update font loading
Browse files Browse the repository at this point in the history
  • Loading branch information
sotasan committed Sep 6, 2023
1 parent 04cce66 commit 36badec
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 196 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ dependencies {
implementation("com.fifesoft:rsyntaxtextarea:3.3.4")
implementation("com.formdev:flatlaf:3.2.1")
implementation("com.formdev:flatlaf-extras:3.2.1")
implementation("com.formdev:flatlaf-fonts-inter:3.19")
implementation("com.formdev:flatlaf-fonts-jetbrains-mono:2.242")
implementation("com.miglayout:miglayout:3.7.4")
implementation("io.github.classgraph:classgraph:4.8.162")
implementation("org.benf:cfr:0.152")
implementation("org.bitbucket.mstrobel:procyon-compilertools:0.6.0")
implementation("org.jetbrains:annotations:24.0.1")
Expand Down
12 changes: 5 additions & 7 deletions src/main/java/com/sotasan/decompiler/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
import com.formdev.flatlaf.FlatDarkLaf;
import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.extras.FlatInspector;
import com.formdev.flatlaf.fonts.inter.FlatInterFont;
import com.formdev.flatlaf.fonts.jetbrains_mono.FlatJetBrainsMonoFont;
import com.sotasan.decompiler.controllers.WindowController;
import com.sotasan.decompiler.services.LoaderService;
import io.github.classgraph.ClassGraph;
import io.github.classgraph.Resource;
import lombok.SneakyThrows;
import lombok.experimental.UtilityClass;
import org.jetbrains.annotations.NotNull;
import java.awt.*;
import java.io.File;
import java.util.Objects;

@UtilityClass
public class Main {
Expand All @@ -23,9 +21,9 @@ public static void main(String @NotNull [] args) {
System.setProperty("apple.awt.application.name", "Decompiler");
System.setProperty("apple.awt.application.appearance", "NSAppearanceNameDarkAqua");

for (Resource font : new ClassGraph().acceptPaths("fonts").scan().getResourcesWithExtension("ttf"))
GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(Font.createFont(Font.PLAIN, Objects.requireNonNull(Main.class.getClassLoader().getResourceAsStream(font.getPath()))));

FlatInterFont.install();
FlatJetBrainsMonoFont.install();
FlatLaf.setPreferredFontFamily(FlatInterFont.FAMILY);
FlatLaf.registerCustomDefaultsSource("themes");
FlatDarkLaf.setup();
FlatInspector.install("meta shift I");
Expand Down
Binary file removed src/main/resources/fonts/Inter/Inter.ttf
Binary file not shown.
94 changes: 0 additions & 94 deletions src/main/resources/fonts/Inter/LICENSE.txt

This file was deleted.

Binary file not shown.
Binary file not shown.
93 changes: 0 additions & 93 deletions src/main/resources/fonts/JetBrainsMono/LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion src/main/resources/themes/FlatLaf.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
defaultFont=Inter
@accentColor=#D08770
@background=#3B4252
@componentBackground=#4C566A
Expand Down

0 comments on commit 36badec

Please sign in to comment.