Install Windows or macOS fonts on Linux
Install and switch between Windows or macOS fonts on Linux, and restore system fonts.
This guide is for Ubuntu / Debian headless crawling servers. Install the font library matching the browser's target platform. Install both libraries if you need to switch between them.
Run the commands as the crawler's user. For Docker deployments, run them inside the browser's container. This guide uses system-wide font settings, not per-browser-instance settings.
| Target platform | Download | Size |
|---|---|---|
| Windows | windows-fonts.zip | About 204 MB |
| macOS | macos-fonts.tar.gz | About 513 MB |
1. Prepare the environment
sudo apt-get update
sudo apt-get install -y ca-certificates curl fontconfig unzip tar gzip
mkdir -p "$HOME/.cache/chrovia-font-downloads"
cd "$HOME/.cache/chrovia-font-downloads"2. Download and extract
Stop the browser, then run the commands for the platform you need. To install both libraries, complete both the Windows and macOS sections.
Windows
curl -fL --retry 3 --connect-timeout 15 \
https://console.getchrovia.com/api/assets/fonts/windows-fonts.zip \
-o windows-fonts.zip &&
printf '%s %s\n' \
f73fafa0081a1ba0714531f7a4d45d4fa47e6fbfa1753a6bd5a030d5f0519fc7 \
windows-fonts.zip | sha256sum -c - &&
sudo mkdir -p /opt/windows-fonts &&
sudo unzip -o windows-fonts.zip -d /opt/windows-fontsAfter extraction, set the font read permissions:
sudo chmod -R a+rX /opt/windows-fontsmacOS
curl -fL --retry 3 --connect-timeout 15 \
https://console.getchrovia.com/api/assets/fonts/macos-fonts.tar.gz \
-o macos-fonts.tar.gz &&
printf '%s %s\n' \
f2e48e5bc9cee81a96adae994a2695d3cfe5ce5dc63dccd5642c61da96397c89 \
macos-fonts.tar.gz | sha256sum -c - &&
sudo mkdir -p /opt/macos-fonts &&
sudo tar --no-same-owner -xzf macos-fonts.tar.gz -C /opt/macos-fonts &&
sudo chmod -R a+rX /opt/macos-fonts3. Select a font library
Run the following commands to enable Windows fonts. To enable macOS fonts, replace /opt/windows-fonts with /opt/macos-fonts in the XML.
sudo rm -f /etc/fonts/conf.d/99-windows-fonts.conf \
/etc/fonts/conf.d/99-macos-fonts.conf
sudo tee /etc/fonts/conf.d/99-chrovia-fonts.conf >/dev/null <<'EOF'
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<reset-dirs />
<dir>/opt/windows-fonts</dir>
</fontconfig>
EOF4. Refresh the cache and verify
Remove any FONTCONFIG_FILE or FONTCONFIG_PATH settings from the browser launcher or service, then run:
unset FONTCONFIG_FILE FONTCONFIG_PATH
fc-cache -f
fc-list --format='%{file}\n' | sort -uConfirm that the list is not empty and all font paths are under the selected /opt/windows-fonts/ or /opt/macos-fonts/ directory.
Check font matching. For macOS, replace Arial with Helvetica:
fc-match -f '%{family}: %{file}\n' 'Arial'Confirm that the returned font family and file path match the selected library, then fully quit and restart the browser or crawler service.
Switch font libraries
Once both libraries are installed and configured as above, stop the browser, then run the commands for the target platform.
Switch to Windows:
sudo sed -i 's|/opt/macos-fonts|/opt/windows-fonts|' /etc/fonts/conf.d/99-chrovia-fonts.conf &&
fc-cache -fSwitch to macOS:
sudo sed -i 's|/opt/windows-fonts|/opt/macos-fonts|' /etc/fonts/conf.d/99-chrovia-fonts.conf &&
fc-cache -fRepeat the font path and matching checks in step 4, then start the browser.
Restore system fonts
Run the following commands to restore system fonts:
sudo rm -f /etc/fonts/conf.d/99-chrovia-fonts.conf &&
fc-cache -fThen fully quit and restart the browser or crawler service.
Open Computed → Rendered Fonts in DevTools to check which fonts a page uses. See Extended Preferences for browser configuration.