Files
lightcraft/packaging/windows/fonts.ps1
Brandon ThomasandClaude Opus 5.5 fd9d045c75 CI: the packaging scripts check out the craft-fonts revision release.yml pins (3d9ab3a, with Noto Sans Thai)
Windows ARM64 on main failed since batch 36: #1479's scripts pinned 8dcdacd, which predates the Thai face #1311
made required.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 02:57:33 -04:00

25 lines
1.4 KiB
PowerShell

# Font setup for local packaging; dot-sourced by package.ps1.
function Initialize-CraftFonts([string] $WorkspaceRoot) {
$fontDir = $env:CRAFT_FONTS_DIR
if (-not $fontDir) { $fontDir = Join-Path $WorkspaceRoot '../craft-fonts' }
if (-not [IO.Path]::IsPathRooted($fontDir)) { $fontDir = Join-Path $WorkspaceRoot $fontDir }
if (-not $env:CRAFT_FONTS_DIR -and -not (Test-Path -LiteralPath $fontDir)) {
# Same revision as release.yml and packaging/fonts.sh. Existing checkouts stay untouched.
$revision = '3d9ab3a132ed0eff457e424226a435a901da30d3'
Write-Output "==> downloading craft-fonts ($revision) to $fontDir"
& git clone --no-checkout https://github.com/storytold/craft-fonts $fontDir
if ($LASTEXITCODE -ne 0) { throw 'Could not download craft-fonts; provide a complete checkout with CRAFT_FONTS_DIR' }
& git -C $fontDir checkout --detach $revision
if ($LASTEXITCODE -ne 0) { throw 'Could not check out craft-fonts; provide a complete checkout with CRAFT_FONTS_DIR' }
}
$manifest = Join-Path $fontDir 'fonts/manifest.txt'
if (-not (Test-Path -LiteralPath $manifest -PathType Leaf)) {
throw "Missing $manifest; set CRAFT_FONTS_DIR to a complete craft-fonts checkout"
}
$env:CRAFT_FONTS_DIR = (Resolve-Path -LiteralPath $fontDir).Path
$env:CRAFT_FONTS_REQUIRED = '1'
Write-Output "==> embedding fonts from $env:CRAFT_FONTS_DIR"
}