Skip to content

Commit 507f0b2

Browse files
committed
CI: Install Fira Sans font for consistent PNG snapshot rendering
Add step to download and install Fira Sans font in CI environment to ensure consistent font rendering between local development and GitHub Actions. This fixes the PNG snapshot test failures caused by font fallback differences.
1 parent c45d09f commit 507f0b2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,18 @@ jobs:
177177
rm -rf "typst-x86_64-unknown-linux-musl" "typst-x86_64-unknown-linux-musl.tar.xz"
178178
typst --version
179179
180+
- name: Install Fira Sans font
181+
run: |
182+
# Download and install Fira Sans
183+
wget -q "https://github.com/mozilla/Fira/archive/4.202.zip"
184+
unzip -q "4.202.zip"
185+
sudo mkdir -p /usr/local/share/fonts/fira-sans
186+
sudo cp Fira-4.202/otf/FiraSans-*.otf /usr/local/share/fonts/fira-sans/
187+
sudo fc-cache -f -v
188+
rm -rf "4.202.zip" "Fira-4.202"
189+
# Verify font is available
190+
fc-list | grep -i "fira sans" || echo "Fira Sans not found"
191+
180192
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
181193
with:
182194
save-if: ${{ github.ref == 'refs/heads/main' }}

0 commit comments

Comments
 (0)