aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/polyfrost/oneconfig/lwjgl/font/FontManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/lwjgl/font/FontManager.java')
-rw-r--r--src/main/java/io/polyfrost/oneconfig/lwjgl/font/FontManager.java31
1 files changed, 0 insertions, 31 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
deleted file mode 100644
index 0ec2b87..0000000
--- a/src/main/java/io/polyfrost/oneconfig/lwjgl/font/FontManager.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package io.polyfrost.oneconfig.lwjgl.font;
-
-import io.polyfrost.oneconfig.lwjgl.IOUtil;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-import static org.lwjgl.nanovg.NanoVG.nvgCreateFontMem;
-
-public class FontManager {
- public static FontManager INSTANCE = new FontManager();
-
- public void initialize(long vg) {
- for (Fonts fonts : Fonts.values()) {
- Font font = fonts.font;
- int loaded = -1;
- try {
- ByteBuffer buffer = IOUtil.resourceToByteBuffer(font.getFileName());
- loaded = nvgCreateFontMem(vg, font.getName(), buffer, 0);
- font.setBuffer(buffer);
- } catch (IOException e) {
- e.printStackTrace();
- }
- if (loaded == -1) {
- throw new RuntimeException("Failed to initialize font " + font.getName());
- } else {
- font.setLoaded(true);
- }
- }
- }
-}