From 44c14ace2cfe0109bb527bc0d172b3aba62043ce Mon Sep 17 00:00:00 2001 From: Jon Kazama Date: Sat, 23 May 2026 18:10:36 +0200 Subject: [PATCH] feat(fonts): add FontsReady gate property Returns true once every required atlas-owned handle reports Available. Components will gate their first-frame draw on this so the layout math runs against the real atlas rather than placeholder metrics. ItalicFont null counts as ready because that means italics are disabled in config. --- HellionChat/FontManager.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/HellionChat/FontManager.cs b/HellionChat/FontManager.cs index 35a50d6..e082e27 100644 --- a/HellionChat/FontManager.cs +++ b/HellionChat/FontManager.cs @@ -39,6 +39,18 @@ public sealed class FontManager : IDisposable internal IFontHandle? RegularFont; internal IFontHandle? ItalicFont; + // True once every required atlas-owned handle reports Available. Components + // gate their first-frame draw on this — without it the layout math would + // run against placeholder font metrics and snap when the real atlas + // finishes building. ItalicFont being null means italics are disabled in + // config, which is a ready state, not a pending one. + public bool FontsReady => + Axis.Available + && AxisItalic.Available + && FontAwesome.Available + && RegularFont is { Available: true } + && (ItalicFont is null || ItalicFont.Available); + private ushort[] Ranges = []; private ushort[] JpRange = [];