Repaint both heads in the v5 palette and embed its three fonts

This commit is contained in:
2026-08-07 15:25:51 +02:00
parent 49645db680
commit bea0279937
16 changed files with 611 additions and 99 deletions
@@ -41,8 +41,8 @@ internal static class HeadlessApp
/// On a machine with no fonts at all it does not merely differ, it stops: <c>FontManager</c> throws
/// "Default font family name can't be null or empty" during <c>AppBuilder.SetupUnsafe</c>, before any
/// test body runs. That is how a container CI runner reports all sixty-eight of these as failures with
/// not one assertion among them. Naming Inter costs the runner nothing, because the font travels
/// inside the package rather than on the host.
/// not one assertion among them. Naming a font costs the runner nothing, because it travels inside the
/// package rather than on the host — true of Inter before this and of Montserrat now.
/// </para>
/// </remarks>
public static AppBuilder BuildAvaloniaApp() =>
@@ -50,13 +50,27 @@ internal static class HeadlessApp
.UseSkia()
.UseHeadless(new AvaloniaHeadlessPlatformOptions { UseHeadlessDrawing = false })
.WithInterFont()
.With(new FontManagerOptions { DefaultFamilyName = InterFamily });
.With(new FontManagerOptions
{
DefaultFamilyName = DefaultFamily,
FontFallbacks = [new FontFallback { FontFamily = new FontFamily(InterFamily) }],
});
/// <summary>The family <c>WithInterFont</c> registers.</summary>
/// <summary>The family <c>Program.BuildAvaloniaApp</c> asks the font manager to default to.</summary>
/// <remarks>
/// Kept in step with <c>Program.BuildAvaloniaApp</c> by hand, and it matters that they agree: a
/// harness pinning a different default from the one the application runs with would certify heights
/// for a window nobody sees, which is the failure the opening paragraph of this file is about.
/// for a window nobody sees, which is the failure the opening paragraph of this file is about. It was
/// Inter until the v3 design; now it is Montserrat, embedded the same way, and Inter moves down to
/// <see cref="InterFamily"/> as the fallback both <c>BuildAvaloniaApp</c> methods name it as.
/// </remarks>
internal const string DefaultFamily = "avares://DodoSSH.Client.Shell/Assets/Fonts#Montserrat";
/// <summary>The family <c>WithInterFont</c> registers.</summary>
/// <remarks>
/// No longer the default — see <see cref="DefaultFamily"/> — but still registered and still named
/// here, because it is still the fallback both heads' <c>BuildAvaloniaApp</c> fall back to, and a test
/// measuring a glyph Montserrat does not cover has to fall back to the same font the application does.
/// </remarks>
internal const string InterFamily = "avares://Avalonia.Fonts.Inter/Assets#Inter";
}