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.
This commit is contained in:
2026-05-23 18:10:36 +02:00
parent 53ed154103
commit 44c14ace2c
+12
View File
@@ -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 = [];