From b9d3ff8f268bdf85fd4f3213d321ff5c3e5e21f3 Mon Sep 17 00:00:00 2001 From: Jon Kazama Date: Tue, 12 May 2026 17:19:28 +0200 Subject: [PATCH] fix(fonts): broaden font fallback catch to handle atlas-toolkit throws (G2) The atlas-toolkit pipeline can throw InvalidOperationException or ArgumentException when a configured font is structurally broken (e.g. unreadable header, unsupported glyph table). Previously only IO-shaped throws routed to the NotoSansCjkRegular fallback, so a corrupt font config would take down the entire atlas build instead of degrading gracefully. The warning log now carries the exception type name so the diagnostic path can tell which class of throw triggered the fallback. --- HellionChat/FontManager.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/HellionChat/FontManager.cs b/HellionChat/FontManager.cs index 17daf5d..809846f 100644 --- a/HellionChat/FontManager.cs +++ b/HellionChat/FontManager.cs @@ -226,11 +226,21 @@ public class FontManager return fontId.AddToBuildToolkit(tk, config); } catch (Exception e) - when (e is FileNotFoundException or DirectoryNotFoundException or IOException) + when (e + is FileNotFoundException + or DirectoryNotFoundException + or IOException + or InvalidOperationException + or ArgumentException + ) { + // Atlas-toolkit throws span IO and validation failures; routing the + // wider set through the fallback keeps a corrupt font config from + // taking down the whole atlas build. Plugin.Log.Warning( e, - $"Configured {slot} font unavailable, falling back to NotoSansCjkRegular" + $"Configured {slot} font failed to load ({e.GetType().Name}), " + + "falling back to NotoSansCjkRegular" ); var fallback = new DalamudAssetFontAndFamilyId(DalamudAsset.NotoSansCjkRegular); return fallback.AddToBuildToolkit(tk, config);