From 628c003e3e607108a41894796eb41b9c7ddc6cf7 Mon Sep 17 00:00:00 2001 From: Death Fuel <108496936+DeathFuel@users.noreply.github.com> Date: Fri, 5 Dec 2025 21:43:51 +0100 Subject: [PATCH] Add a glyph replacement map (#219) Co-authored-by: boubou19 --- .../gtnhlib/util/font/GlyphReplacements.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/main/java/com/gtnewhorizon/gtnhlib/util/font/GlyphReplacements.java diff --git a/src/main/java/com/gtnewhorizon/gtnhlib/util/font/GlyphReplacements.java b/src/main/java/com/gtnewhorizon/gtnhlib/util/font/GlyphReplacements.java new file mode 100644 index 00000000..2bdead7d --- /dev/null +++ b/src/main/java/com/gtnewhorizon/gtnhlib/util/font/GlyphReplacements.java @@ -0,0 +1,22 @@ +package com.gtnewhorizon.gtnhlib.util.font; + +import java.util.HashMap; + +public class GlyphReplacements { + + /** + * A mapping from custom glyphs to the values they are meant to replace (which may be null for novel glyphs or when + * the original comes from outside the BMP). + */ + public static final HashMap customGlyphs = new HashMap<>(64); + + public static String registerCustomGlyph(String replacement, String original) { + customGlyphs.put(replacement, original); + return replacement; + } + + public static String registerCustomGlyph(String replacement) { + customGlyphs.put(replacement, null); + return replacement; + } +}