fix(windows): the launcher's fonts come from Windows' own DirectWrite, not a DWriteCore.dll another program left on the PATH, and a PC that still gives none gets a message (#123) #134

Merged
HumanBean merged 1 commit from HumanBean/LongshotLauncher:fix/system-directwrite into main 2026-11-16 04:25:47 +00:00
Owner

The launcher and its setup still close without a word on Sanoku's Windows 11 PC (#123): after #131 made Inter the default font, nightly 98 crashes on Could not create glyphTypeface. Font family: Inter … Weight: DemiBold, so the PC gives Skia no fonts at all, the bundled ones included.

Cause

Avalonia makes every font, the system's and our own Inter alike, through Skia's one font manager, and on Windows Skia's only font backend is DirectWrite (checked in SkiaSharp 3.119.4's libSkiaSharp.dll). Skia's SkDWrite.cpp asks LoadLibraryW(L"DWriteCore.dll") before dwrite.dll, and keeps to it when it is found. A DWriteCore.dll (Windows App SDK) that another program left on the PATH and that gives no factory leaves Skia with an empty font manager: an empty default font name (the first crash), then no embedded Inter (the second). Not yet confirmed on Sanoku's PC: where DWriteCore.dll there would.

Change

  • FontCheck.PreferSystemDirectWrite(), first thing in Main: DLLs named without a path come from the launcher's folder and System32 only (SetDefaultDllDirectories), no PATH and no current folder. .NET loads the launcher's own native libraries by their full path from the single-file extraction, so they are unaffected.
  • When the window's start still fails in Avalonia's font code on Windows, a message box says the launcher got no fonts, with the exception, Skia's and DirectWrite's family counts (DirectWrite asked directly, with its HRESULT), any DWriteCore.dll found, and the Windows version, instead of a silent crash.

Tests

  • dotnet build App -c Release and -r win-x64 build.
  • python -I tests/test_launcher_core.py and python -I tests/test_release.py pass.
  • Not run on Windows: needs a start on an ordinary Windows PC (the narrower DLL search) before a release.

No screenshots: the message box only shows on a PC whose fonts fail.

🤖 Generated with Claude Code

The launcher and its setup still close without a word on Sanoku's Windows 11 PC (#123): after #131 made Inter the default font, nightly 98 crashes on `Could not create glyphTypeface. Font family: Inter … Weight: DemiBold`, so the PC gives Skia no fonts at all, the bundled ones included. ## Cause Avalonia makes every font, the system's and our own Inter alike, through Skia's one font manager, and on Windows Skia's only font backend is DirectWrite (checked in SkiaSharp 3.119.4's `libSkiaSharp.dll`). Skia's `SkDWrite.cpp` asks `LoadLibraryW(L"DWriteCore.dll")` **before** `dwrite.dll`, and keeps to it when it is found. A `DWriteCore.dll` (Windows App SDK) that another program left on the PATH and that gives no factory leaves Skia with an empty font manager: an empty default font name (the first crash), then no embedded Inter (the second). Not yet confirmed on Sanoku's PC: `where DWriteCore.dll` there would. ## Change - `FontCheck.PreferSystemDirectWrite()`, first thing in `Main`: DLLs named without a path come from the launcher's folder and System32 only (`SetDefaultDllDirectories`), no PATH and no current folder. .NET loads the launcher's own native libraries by their full path from the single-file extraction, so they are unaffected. - When the window's start still fails in Avalonia's font code on Windows, a message box says the launcher got no fonts, with the exception, Skia's and DirectWrite's family counts (DirectWrite asked directly, with its HRESULT), any `DWriteCore.dll` found, and the Windows version, instead of a silent crash. ## Tests - `dotnet build App -c Release` and `-r win-x64` build. - `python -I tests/test_launcher_core.py` and `python -I tests/test_release.py` pass. - Not run on Windows: needs a start on an ordinary Windows PC (the narrower DLL search) before a release. No screenshots: the message box only shows on a PC whose fonts fail. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(windows): the launcher's fonts come from Windows' own DirectWrite, not a DWriteCore.dll another program left on the PATH, and a PC that still gives none gets a message (#123)
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 4s
b1cf01c6c1
Skia, which makes every font of the window, asks for DWriteCore.dll by name before Windows' own dwrite.dll and keeps to it when it
is found: one another program left on the PATH that gives no factory left the launcher with no fonts, and it closed without a word.
DLLs named without a path now come from the launcher's folder and System32 only; when fonts still fail, a message says so with what
DirectWrite answered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean deleted branch fix/system-directwrite 2026-11-16 04:25:47 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!134
No description provided.