In this short guide, you'll see how to install WOFF (Web Open Font Format) font files on Ubuntu and Linux systems.
Here you can find the short answer:
(1) Convert WOFF to TTF first
sudo apt install woff2
woff2_decompress font.woff2
(2) Install font system-wide
sudo mkdir -p /usr/local/share/fonts/custom
sudo cp font.ttf /usr/local/share/fonts/custom/
sudo fc-cache -f -v
(3) Install for current user only
mkdir -p ~/.local/share/fonts
cp font.ttf ~/.local/share/fonts/
fc-cache -f
So let's see several methods to install WOFF fonts like Excalifont and Virgil on Ubuntu.
Suppose you want to install fonts like:
- Excalifont - Hand-drawn style font for Excalidraw
- Virgil - Sketch-style handwriting font
- Custom WOFF fonts from web projects
1: Convert WOFF to TTF format
Let's start with converting WOFF fonts to TTF format, since Linux font management works better with TTF/OTF:
sudo apt update
sudo apt install woff2
cd ~/Downloads
woff2_decompress Excalifont.woff2
ls -lh Excalifont*
result will be:
-rw-r--r-- 1 user user 45K Dec 15 10:30 Excalifont.woff2
-rw-r--r-- 1 user user 89K Dec 15 10:31 Excalifont.ttf
The woff2_decompress tool converts WOFF2 files to TTF format, which is compatible with all Linux applications.
For WOFF (version 1) files, use FontForge instead:
sudo apt install fontforge
fontforge -lang=py -c 'import fontforge; \
f=fontforge.open("Virgil.woff"); \
f.generate("Virgil.ttf")'
result:
Virgil.ttf successfully created
2: Install fonts system-wide for all users
The recommended method for system-wide installation puts fonts in /usr/local/share/fonts/:
sudo mkdir -p /usr/local/share/fonts/excalidraw
sudo cp Excalifont.ttf /usr/local/share/fonts/excalidraw/
sudo cp Virgil.ttf /usr/local/share/fonts/excalidraw/
sudo fc-cache -f -v
fc-list | grep -i excalifont
result:
Scanning directory /usr/local/share/fonts/excalidraw
/usr/local/share/fonts/excalidraw: caching, new cache contents: 2 fonts, 0 dirs
/usr/local/share/fonts/excalidraw/Excalifont.ttf: Excalifont:style=Regular
What each command does:
mkdir -p- Creates font directory structurecp- Copies font files to system locationfc-cache -f -v- Rebuilds font cache (critical step)fc-list- Verifies fonts are installed and available
Fonts are now available system-wide for all users and applications including LibreOffice, GIMP, Inkscape, and web browsers.
3: Install fonts for current user only
For single-user installations or when you don't have sudo access, install to your home directory:
mkdir -p ~/.local/share/fonts/custom
cp Excalifont.ttf ~/.local/share/fonts/custom/
cp Virgil.ttf ~/.local/share/fonts/custom/
fc-cache -f
fc-list | grep -E "(Excalifont|Virgil)"
result:
/home/user/.local/share/fonts/custom/Excalifont.ttf: Excalifont:style=Regular
/home/user/.local/share/fonts/custom/Virgil.ttf: Virgil:style=Regular
This method doesn't require sudo and fonts are immediately available in your applications after running fc-cache.
4: Install multiple fonts with a script
For installing multiple fonts from a project like Excalidraw, automate the process:
#!/bin/bash
FONT_DIR="$HOME/.local/share/fonts/excalidraw"
TEMP_DIR=$(mktemp -d)
cd "$TEMP_DIR"
wget https://plus.excalidraw.com/excalifont -O Excalifont.woff2
wget https://plus.excalidraw.com/virgil -O Virgil.woff2
for woff in *.woff2; do
woff2_decompress "$woff"
done
mkdir -p "$FONT_DIR"
cp *.ttf "$FONT_DIR/"
fc-cache -f
echo "Installed fonts:"
fc-list | grep -E "(Excalifont|Virgil)"
rm -rf "$TEMP_DIR"
result:
Installed fonts:
/home/user/.local/share/fonts/excalidraw/Excalifont.ttf: Excalifont:style=Regular
/home/user/.local/share/fonts/excalidraw/Virgil.ttf: Virgil:style=Regular
This script downloads, converts, installs, and verifies fonts automatically.
5: Verify font installation in applications
After installation, verify fonts work in your applications:
Command line check:
fc-list : family | grep -i excali
fc-match Excalifont
result:
Excalifont
Excalifont.ttf: "Excalifont" "Regular"
LibreOffice test:
- Open LibreOffice Writer
- Click Font dropdown
- Type "Excalifont"
- Font should appear in list
GIMP test:
- Open GIMP
- Select Text tool (T)
- Click Font selector
- Search for "Virgil"
Web browser test:
Create test.html:
<!DOCTYPE html>
<html>
<head>
<style>
@font-face {
font-family: 'Excalifont';
src: local('Excalifont');
}
body { font-family: 'Excalifont', sans-serif; font-size: 24px; }
</style>
</head>
<body>
<p>Testing Excalifont installation</p>
</body>
</html>
Troubleshooting Common Issues
Problem: Font not showing after fc-cache
Solution: Restart the application or log out/in
Problem: "woff2_decompress not found"
Solution: Install woff2 tools: sudo apt install woff2
Problem: Permission denied when copying to /usr/local/share/fonts
Solution: Use sudo or install to ~/.local/share/fonts/ instead
Problem: Font appears but looks wrong
Solution: Clear font cache: rm -rf ~/.cache/fontconfig/
Font Directories on Linux
| Location | Scope | Requires Sudo | Use Case |
|---|---|---|---|
/usr/share/fonts/ |
System | Yes | Distribution-managed |
/usr/local/share/fonts/ |
System | Yes | Manually installed |
~/.local/share/fonts/ |
User | No | Personal fonts |
~/.fonts/ |
User (deprecated) | No | Legacy location |