windows: avoid fontconfig and ensure build compiles (#11698)

This changes allows me to use ghostty as a zon dependency when building
on windows (for windows). Fixes
https://github.com/ghostty-org/ghostty/discussions/11697
This commit is contained in:
Mitchell Hashimoto
2026-03-20 09:55:16 -07:00
committed by GitHub
2 changed files with 12 additions and 0 deletions

View File

@@ -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: |

View File

@@ -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.