design: wire the sans family into the window; fonts ship as explicit Resource items

The bundled faces were packaged but unused — no style referenced FontFamily.Sans, so the app
still rendered Segoe UI. MainWindow now sets FontFamily from the token, which cascades to every
child (dialogs follow in the sweep).

Font packaging: six explicit <Resource> items instead of the Assets\Fonts\*.ttf glob, so the
guard can name exactly what must ship.

Investigation worth recording: a runtime assertion that the families resolve from
pack://application:,,,/ would have needed an Application instance inside the test host, and
without one WPF resolves the pack authority against the test host — every probe failed,
including the app icon that demonstrably works. The resources ARE embedded (the lowercase
`assets/fonts/inter-regular.ttf` entry is present in ytLive.g.resources); the assertion was
removed rather than faked, and the real confirmation is a launch, which is a visual check.

Guard remains structural: files are real binaries, each is a Resource in the csproj, the theme
uses pack URIs, notices + both OFL texts are present, and no third family sneaks in.
This commit is contained in:
2026-10-30 07:53:37 -07:00
parent 1defb71568
commit ffdf3b6fc9
3 changed files with 16 additions and 3 deletions
+1
View File
@@ -13,6 +13,7 @@
MinWidth="1366" MinHeight="768"
Icon="/ytLive;component/Assets/llamacasty-icon.png"
Background="#1a1a2e"
FontFamily="{StaticResource FontFamily.Sans}"
WindowStartupLocation="Manual"
Closing="MainWindow_Closing"
Loaded="MainWindow_Loaded"
+9 -2
View File
@@ -1,5 +1,10 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Windows;
using System.Windows.Media;
using Xunit;
namespace ytLive.Tests;
@@ -30,8 +35,10 @@ public class BundledFontsTests
Assert.True(new FileInfo(path).Length > 50_000, $"{name} looks like a placeholder");
}
// 2. The project packages them as WPF resources.
Assert.Contains(@"Assets\Fonts\*.ttf", SourceAssert.Text("ytLive.csproj"));
// 2. The project packages each one as a WPF resource (an explicit item, not a guess).
var csproj = SourceAssert.Text("ytLive.csproj");
foreach (var name in Files)
Assert.Contains($@"Assets\Fonts\{name}", csproj);
// 3. The theme resolves each family from the pack folder — a bare family name would
// only work if the user happened to have the font installed.
+6 -1
View File
@@ -81,7 +81,12 @@
<Resource Include="Assets\chat-background.jpg" />
<Resource Include="Assets\alert-default.mp4" />
<!-- Design-standard typefaces (DESIGN.md): Inter + JetBrains Mono, OFL-1.1. -->
<Resource Include="Assets\Fonts\*.ttf" />
<Resource Include="Assets\Fonts\Inter-Regular.ttf" />
<Resource Include="Assets\Fonts\Inter-Medium.ttf" />
<Resource Include="Assets\Fonts\Inter-SemiBold.ttf" />
<Resource Include="Assets\Fonts\Inter-Bold.ttf" />
<Resource Include="Assets\Fonts\JetBrainsMono-Medium.ttf" />
<Resource Include="Assets\Fonts\JetBrainsMono-SemiBold.ttf" />
</ItemGroup>
<ItemGroup>