diff options
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/lwjgl/font')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Font.java | 20 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Fonts.java | 10 |
2 files changed, 24 insertions, 6 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Font.java b/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Font.java index 970c073..649252b 100644 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Font.java +++ b/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Font.java @@ -7,10 +7,16 @@ public class Font { private final String name; private boolean loaded = false; private ByteBuffer buffer = null; + private final int unitsPerEm; + private final int ascender; + private final int descender; - public Font(String name, String fileName) { + public Font(String name, String fileName, int unitsPerEm, int ascender, int descender) { this.name = name; this.fileName = fileName; + this.unitsPerEm = unitsPerEm; + this.ascender = ascender; + this.descender = descender; } public String getName() { @@ -36,4 +42,16 @@ public class Font { void setBuffer(ByteBuffer buffer) { this.buffer = buffer; } + + public int getUnitsPerEm() { + return unitsPerEm; + } + + public int getAscender() { + return ascender; + } + + public int getDescender() { + return descender; + } } diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Fonts.java b/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Fonts.java index aef639c..d2b94f0 100644 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Fonts.java +++ b/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Fonts.java @@ -1,11 +1,11 @@ package cc.polyfrost.oneconfig.lwjgl.font; public enum Fonts { - INTER_BOLD(new Font("inter-bold", "/assets/oneconfig/font/Inter-Bold.otf")), - 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")); + // https://opentype.js.org/font-inspector.html + BOLD(new Font("inter-bold", "/assets/oneconfig/font/Bold.otf", 2816, 2728, -680)), + SEMIBOLD(new Font("inter-semibold", "/assets/oneconfig/font/SemiBold.otf", 2816, 2728, -68)), + MEDIUM(new Font("inter-medium", "/assets/oneconfig/font/Medium.otf", 2816, 2728, -680)), + REGULAR(new Font("inter-regular", "/assets/oneconfig/font/Regular.otf", 2816, 2728, -680)); public final Font font; |