Public Access
Give the phone the desktop's face: Montserrat by default
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
// See the note at the top of MainActivity for why the platform namespaces are reached through `global::`.
|
// See the note at the top of MainActivity for why the platform namespaces are reached through `global::`.
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Android;
|
using Avalonia.Android;
|
||||||
|
using Avalonia.Media;
|
||||||
using DodoSSH.Client.Android.Platform;
|
using DodoSSH.Client.Android.Platform;
|
||||||
using global::Android.App;
|
using global::Android.App;
|
||||||
using global::Android.Runtime;
|
using global::Android.Runtime;
|
||||||
@@ -46,6 +47,30 @@ public sealed class DodoSshAndroidApplication : AvaloniaAndroidApplication<DodoS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
/// <remarks>
|
||||||
|
/// This used to be the one place the two heads disagreed on purpose: the recorded v2 decision was
|
||||||
|
/// "Android recolours with the shared palette and keeps its own default sans", on the reasoning that a
|
||||||
|
/// phone's system font is a phone's own business. The user has reversed that, this pass — the phone now
|
||||||
|
/// takes the desktop's face as well as its colours, and <c>docs/design-import-gaps.md</c> is corrected
|
||||||
|
/// to say so rather than left asserting a decision that no longer holds.
|
||||||
|
///
|
||||||
|
/// <c>WithInterFont</c> still registers Inter, for the same reason <c>Program.cs</c> keeps it on the
|
||||||
|
/// desktop: it is what the layout suite pins and what a glyph Montserrat does not cover falls back to.
|
||||||
|
/// What changes is which face answers first. Montserrat ships embedded in
|
||||||
|
/// <c>DodoSSH.Client.Shell/Assets/Fonts</c> already — this project references that assembly for
|
||||||
|
/// <c>Theme/Phone.axaml</c>'s own <c>MonoFont</c>, so no csproj or asset work was needed to reach it
|
||||||
|
/// from here, only the same <see cref="FontManagerOptions"/> block the desktop's
|
||||||
|
/// <c>Program.BuildAvaloniaApp</c> sets.
|
||||||
|
/// </remarks>
|
||||||
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) =>
|
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) =>
|
||||||
base.CustomizeAppBuilder(builder).WithInterFont();
|
base.CustomizeAppBuilder(builder)
|
||||||
|
.WithInterFont()
|
||||||
|
.With(new FontManagerOptions
|
||||||
|
{
|
||||||
|
DefaultFamilyName = "avares://DodoSSH.Client.Shell/Assets/Fonts#Montserrat",
|
||||||
|
FontFallbacks =
|
||||||
|
[
|
||||||
|
new FontFallback { FontFamily = new FontFamily("avares://Avalonia.Fonts.Inter/Assets#Inter") },
|
||||||
|
],
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user