From 64f7d9b9759a9ec43aa8d19c50f5b2c13b827a22 Mon Sep 17 00:00:00 2001 From: Jon Kazama Date: Wed, 19 Aug 2026 09:51:53 +0200 Subject: [PATCH] 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. --- HellionChat/FontManager.cs | 36 ++++++++++++-------------- HellionChat/SelfTests/TypeScaleStep.cs | 9 ++----- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/HellionChat/FontManager.cs b/HellionChat/FontManager.cs index 79fcb6a..fd09a69 100644 --- a/HellionChat/FontManager.cs +++ b/HellionChat/FontManager.cs @@ -59,7 +59,13 @@ public sealed class FontManager : IDisposable private Func? _typographySource; // 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 // 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 // eighty glyphs' worth of use. Anything translated -- the header's stand-in // when no world is known -- goes through the body face instead. - private static readonly ushort[] MetaRange = - [ - 0x0020, - 0x007E, - 0x00B7, - 0x00B7, - 0, - ]; + private static readonly ushort[] MetaRange = [0x0020, 0x007E, 0x00B7, 0x00B7, 0]; // 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 @@ -219,8 +218,13 @@ public sealed class FontManager : IDisposable // 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 // on -- a theme override moves the base without moving any factor. - internal (float Global, float Symbols, float Sender, float Meta, float Italic) - EffectiveFontFingerprint() + internal ( + float Global, + float Symbols, + float Sender, + float Meta, + float Italic + ) EffectiveFontFingerprint() { var basePt = ResolveGlobalFontPt(); return ( @@ -303,10 +307,7 @@ public sealed class FontManager : IDisposable atlas.NewDelegateFontHandle(e => e.OnPreBuild(tk => { - var basePt = TypeScale.SizePtOf( - TypeRole.Sender, - ResolveGlobalFontPt() - ); + var basePt = TypeScale.SizePtOf(TypeRole.Sender, ResolveGlobalFontPt()); var config = new SafeFontConfig { SizePt = basePt, @@ -328,10 +329,7 @@ public sealed class FontManager : IDisposable atlas.NewDelegateFontHandle(e => e.OnPreBuild(tk => { - var basePt = TypeScale.SizePtOf( - TypeRole.Meta, - ResolveGlobalFontPt() - ); + var basePt = TypeScale.SizePtOf(TypeRole.Meta, ResolveGlobalFontPt()); var config = new SafeFontConfig { SizePt = basePt, GlyphRanges = MetaRange }; var bundledBytes = Plugin.Config.UseHellionFont ? TryGetBundledFontBytes() : null; config.MergeFont = bundledBytes is not null diff --git a/HellionChat/SelfTests/TypeScaleStep.cs b/HellionChat/SelfTests/TypeScaleStep.cs index 0de8c73..1456f97 100644 --- a/HellionChat/SelfTests/TypeScaleStep.cs +++ b/HellionChat/SelfTests/TypeScaleStep.cs @@ -96,12 +96,7 @@ internal sealed class TypeScaleStep : ISelfTestStep } } - private static void ReportRole( - FontManager fm, - TypeRole role, - float basePt, - IFontHandle handle - ) + private static void ReportRole(FontManager fm, TypeRole role, float basePt, IFontHandle handle) { var expected = TypeScale.SizePtOf(role, basePt); using (handle.Push()) @@ -110,7 +105,7 @@ internal sealed class TypeScaleStep : ISelfTestStep var expectedPx = FontManager.SizeInPx(expected) * ImGuiHelpers.GlobalScale; var agrees = MathF.Abs(actualPx - expectedPx) < 1.5f; 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")}" ); }