From 1c406fcfbc6f29d371086261cc5f7cb89df96ef0 Mon Sep 17 00:00:00 2001 From: Dek Date: Sun, 30 Aug 2026 11:51:09 -0400 Subject: [PATCH] Fixed bold italic fonts not being restored on restart --- .../settings/FontFaceSetting.java | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/settings/FontFaceSetting.java b/src/main/java/meteordevelopment/meteorclient/settings/FontFaceSetting.java index e51ed32ada3..2e766e66e24 100644 --- a/src/main/java/meteordevelopment/meteorclient/settings/FontFaceSetting.java +++ b/src/main/java/meteordevelopment/meteorclient/settings/FontFaceSetting.java @@ -66,24 +66,19 @@ protected CompoundTag save(CompoundTag tag) { @Override protected FontFace load(CompoundTag tag) { String family = tag.getStringOr("family", ""); - FontInfo.Type type; + FontInfo.Type type = FontInfo.Type.fromString(tag.getStringOr("type", "")); - try { - type = FontInfo.Type.valueOf(tag.getStringOr("type", "")); - } catch (IllegalArgumentException _) { - set(Fonts.DEFAULT_FONT); - return get(); - } - - boolean changed = false; for (FontFamily fontFamily : Fonts.FONT_FAMILIES) { - if (fontFamily.getName().equals(family)) { - set(fontFamily.get(type)); - changed = true; + if (!fontFamily.getName().equals(family)) continue; + + FontFace face = fontFamily.get(type); + if (face != null) { + set(face); + return get(); } } - if (!changed) set(Fonts.DEFAULT_FONT); + set(Fonts.DEFAULT_FONT); return get(); }