From 089bac89c5435eb7e5cf80e7602da953a65f5b1a Mon Sep 17 00:00:00 2001 From: Moulberry Date: Mon, 23 Nov 2020 03:34:12 +1100 Subject: 1.7 --- .../moulberry/notenoughupdates/util/Utils.java | 37 ++++++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java index e2faa5aa..667128b9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java @@ -479,9 +479,40 @@ public class Utils { } public static void drawStringF(String str, FontRenderer fr, float x, float y, boolean shadow, int colour) { - GL11.glTranslatef(x, y, 0); - fr.drawString(str, 0, 0, colour, shadow); - GL11.glTranslatef(-x, -y, 0); + fr.drawString(str, x, y, colour, shadow); + } + + public static int getCharVertLen(char c) { + if("acegmnopqrsuvwxyz".indexOf(c) >= 0) { + return 5; + } else { + return 7; + } + } + + public static float getVerticalHeight(String str) { + str = cleanColour(str); + float height = 0; + for(int i=0; i