From 542d6aa14d2f9a4d522f3ca614dbcc6264191740 Mon Sep 17 00:00:00 2001 From: Jonathan Marler Date: Fri, 20 Mar 2026 10:27:40 -0600 Subject: [PATCH] windows: avoid fontconfig and ensure build compiles --- .github/workflows/test.yml | 4 ++++ src/font/backend.zig | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fbbfa8714..21728b809 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -744,6 +744,10 @@ jobs: Write-Host "Zig installed." .\zig\zig.exe version + - name: Compile build + shell: pwsh + run: .\zig\zig.exe build --help + - name: Generate build testing script shell: pwsh run: | diff --git a/src/font/backend.zig b/src/font/backend.zig index 37b3189b6..d24edec79 100644 --- a/src/font/backend.zig +++ b/src/font/backend.zig @@ -40,6 +40,14 @@ pub const Backend = enum { }; } + if (target.os.tag == .windows) { + // Avoid fontconfig on Windows because its libxml2 dependency + // may not unpack due to symlinks. Use plain freetype for now + // which means no font discovery. Full solution would likely use + // DirectWrite which has its own discovery API. + return .freetype; + } + // macOS also supports "coretext_freetype" but there is no scenario // that is the default. It is only used by people who want to // self-compile Ghostty and prefer the freetype aesthetic.