style: let csharpier reflow the widened tuples

Formatting only. The five-element fingerprint tuple and its field declaration ran
past the line limit, and preflight block E is stricter than the check I had been
running per task -- it caught what the narrower filter did not.
This commit is contained in:
2026-08-19 09:51:53 +02:00
parent 81456c981b
commit 64f7d9b975
2 changed files with 19 additions and 26 deletions
+17 -19
View File
@@ -59,7 +59,13 @@ public sealed class FontManager : IDisposable
private Func<ThemeTypography?>? _typographySource; private Func<ThemeTypography?>? _typographySource;
// Lets RebuildDelegateFontsIfChanged skip rebuilds when the size is unchanged. // Lets RebuildDelegateFontsIfChanged skip rebuilds when the size is unchanged.
private (float Global, float Symbols, float Sender, float Meta, float Italic) _lastBuiltFingerprint; private (
float Global,
float Symbols,
float Sender,
float Meta,
float Italic
) _lastBuiltFingerprint;
// True once every required atlas-owned handle reports Available. Components // True once every required atlas-owned handle reports Available. Components
// gate their first-frame draw on this — without it the layout math would // gate their first-frame draw on this — without it the layout math would
@@ -92,14 +98,7 @@ public sealed class FontManager : IDisposable
// A full range here would rasterise the whole CJK set a second time for // A full range here would rasterise the whole CJK set a second time for
// eighty glyphs' worth of use. Anything translated -- the header's stand-in // eighty glyphs' worth of use. Anything translated -- the header's stand-in
// when no world is known -- goes through the body face instead. // when no world is known -- goes through the body face instead.
private static readonly ushort[] MetaRange = private static readonly ushort[] MetaRange = [0x0020, 0x007E, 0x00B7, 0x00B7, 0];
[
0x0020,
0x007E,
0x00B7,
0x00B7,
0,
];
// Report accessor for the ctor self-test: built glyph-range array lengths so // Report accessor for the ctor self-test: built glyph-range array lengths so
// the step can show the B1 dedup effect (a small trimmed fallback vs the large // the step can show the B1 dedup effect (a small trimmed fallback vs the large
@@ -219,8 +218,13 @@ public sealed class FontManager : IDisposable
// Every size that can land in one message row. Roles follow the base size // Every size that can land in one message row. Roles follow the base size
// arithmetically, but the resolved value is what the height cache has to key // arithmetically, but the resolved value is what the height cache has to key
// on -- a theme override moves the base without moving any factor. // on -- a theme override moves the base without moving any factor.
internal (float Global, float Symbols, float Sender, float Meta, float Italic) internal (
EffectiveFontFingerprint() float Global,
float Symbols,
float Sender,
float Meta,
float Italic
) EffectiveFontFingerprint()
{ {
var basePt = ResolveGlobalFontPt(); var basePt = ResolveGlobalFontPt();
return ( return (
@@ -303,10 +307,7 @@ public sealed class FontManager : IDisposable
atlas.NewDelegateFontHandle(e => atlas.NewDelegateFontHandle(e =>
e.OnPreBuild(tk => e.OnPreBuild(tk =>
{ {
var basePt = TypeScale.SizePtOf( var basePt = TypeScale.SizePtOf(TypeRole.Sender, ResolveGlobalFontPt());
TypeRole.Sender,
ResolveGlobalFontPt()
);
var config = new SafeFontConfig var config = new SafeFontConfig
{ {
SizePt = basePt, SizePt = basePt,
@@ -328,10 +329,7 @@ public sealed class FontManager : IDisposable
atlas.NewDelegateFontHandle(e => atlas.NewDelegateFontHandle(e =>
e.OnPreBuild(tk => e.OnPreBuild(tk =>
{ {
var basePt = TypeScale.SizePtOf( var basePt = TypeScale.SizePtOf(TypeRole.Meta, ResolveGlobalFontPt());
TypeRole.Meta,
ResolveGlobalFontPt()
);
var config = new SafeFontConfig { SizePt = basePt, GlyphRanges = MetaRange }; var config = new SafeFontConfig { SizePt = basePt, GlyphRanges = MetaRange };
var bundledBytes = Plugin.Config.UseHellionFont ? TryGetBundledFontBytes() : null; var bundledBytes = Plugin.Config.UseHellionFont ? TryGetBundledFontBytes() : null;
config.MergeFont = bundledBytes is not null config.MergeFont = bundledBytes is not null
+2 -7
View File
@@ -96,12 +96,7 @@ internal sealed class TypeScaleStep : ISelfTestStep
} }
} }
private static void ReportRole( private static void ReportRole(FontManager fm, TypeRole role, float basePt, IFontHandle handle)
FontManager fm,
TypeRole role,
float basePt,
IFontHandle handle
)
{ {
var expected = TypeScale.SizePtOf(role, basePt); var expected = TypeScale.SizePtOf(role, basePt);
using (handle.Push()) using (handle.Push())
@@ -110,7 +105,7 @@ internal sealed class TypeScaleStep : ISelfTestStep
var expectedPx = FontManager.SizeInPx(expected) * ImGuiHelpers.GlobalScale; var expectedPx = FontManager.SizeInPx(expected) * ImGuiHelpers.GlobalScale;
var agrees = MathF.Abs(actualPx - expectedPx) < 1.5f; var agrees = MathF.Abs(actualPx - expectedPx) < 1.5f;
ImGui.TextUnformatted( ImGui.TextUnformatted(
$"{role,-7} expected {expected:0.00}pt ({expectedPx:0.0}px) " $"{role, -7} expected {expected:0.00}pt ({expectedPx:0.0}px) "
+ $"| actual {actualPx:0.0}px {(agrees ? "OK" : "MISMATCH")}" + $"| actual {actualPx:0.0}px {(agrees ? "OK" : "MISMATCH")}"
); );
} }