aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/polyfrost/oneconfig/lwjgl/font
diff options
context:
space:
mode:
authornextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com>2022-04-21 14:19:44 +0100
committernextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com>2022-04-21 14:19:44 +0100
commit260d48126cbedb4341c5c5865bfd8e605f90955a (patch)
tree563f65d65d708f24df33759c411b0f2338c1933e /src/main/java/io/polyfrost/oneconfig/lwjgl/font
parent30df910cf3b2f5b0683ce01e391c35829d8a5850 (diff)
downloadOneConfig-260d48126cbedb4341c5c5865bfd8e605f90955a.tar.gz
OneConfig-260d48126cbedb4341c5c5865bfd8e605f90955a.tar.bz2
OneConfig-260d48126cbedb4341c5c5865bfd8e605f90955a.zip
more gui things like text field and button
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/lwjgl/font')
-rw-r--r--src/main/java/io/polyfrost/oneconfig/lwjgl/font/FontManager.java9
-rw-r--r--src/main/java/io/polyfrost/oneconfig/lwjgl/font/Fonts.java18
2 files changed, 20 insertions, 7 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/lwjgl/font/FontManager.java b/src/main/java/io/polyfrost/oneconfig/lwjgl/font/FontManager.java
index 08d108b..0ec2b87 100644
--- a/src/main/java/io/polyfrost/oneconfig/lwjgl/font/FontManager.java
+++ b/src/main/java/io/polyfrost/oneconfig/lwjgl/font/FontManager.java
@@ -4,20 +4,15 @@ import io.polyfrost.oneconfig.lwjgl.IOUtil;
import java.io.IOException;
import java.nio.ByteBuffer;
-import java.util.ArrayList;
import static org.lwjgl.nanovg.NanoVG.nvgCreateFontMem;
public class FontManager {
public static FontManager INSTANCE = new FontManager();
- private final ArrayList<Font> fonts = new ArrayList<>();
public void initialize(long vg) {
- fonts.add(new Font("inter-bold", "/assets/oneconfig/font/Inter-Bold.ttf"));
- fonts.add(new Font("inter-regular", "/assets/oneconfig/font/Inter-Regular.otf"));
- fonts.add(new Font("inter-semibold", "/assets/oneconfig/font/Inter-SemiBold.otf"));
- fonts.add(new Font("mc-regular", "/assets/oneconfig/font/Minecraft-Regular.otf"));
- for (Font font : fonts) {
+ for (Fonts fonts : Fonts.values()) {
+ Font font = fonts.font;
int loaded = -1;
try {
ByteBuffer buffer = IOUtil.resourceToByteBuffer(font.getFileName());
diff --git a/src/main/java/io/polyfrost/oneconfig/lwjgl/font/Fonts.java b/src/main/java/io/polyfrost/oneconfig/lwjgl/font/Fonts.java
new file mode 100644
index 0000000..5d36271
--- /dev/null
+++ b/src/main/java/io/polyfrost/oneconfig/lwjgl/font/Fonts.java
@@ -0,0 +1,18 @@
+package io.polyfrost.oneconfig.lwjgl.font;
+
+public enum Fonts {
+
+ INTER_BOLD(new Font("inter-bold", "/assets/oneconfig/font/Inter-Bold.ttf")),
+ INTER_REGULAR(new Font("inter-regular", "/assets/oneconfig/font/Inter-Regular.otf")),
+ INTER_SEMIBOLD(new Font("inter-semibold", "/assets/oneconfig/font/Inter-SemiBold.otf")),
+ INTER_MEDIUM(new Font("inter-medium", "/assets/oneconfig/font/Inter-Medium.otf")),
+ MC_REGULAR(new Font("mc-regular", "/assets/oneconfig/font/Minecraft-Regular.otf"));
+
+ public final Font font;
+
+ Fonts(Font font) {
+ this.font = font;
+ }
+
+
+}