Fonts
5.1
How to add fonts to SliTaz: from the packages, or your own font files.
The desktop font itself is set in lxappearance, see
Dark and light theme.
What is installed
The desktop images come with DejaVu (ttf-dejavu), the default font of
the desktop, and the console font Terminus (terminus-font-base).
Fonts are handled by fontconfig: it finds every font in
/usr/share/fonts for all users, and in ~/.local/share/fonts or
~/.fonts for one user.
To see which fonts the system knows:
$ fc-list : family
$ fc-match sans-serif
$ fc-match monospace
fc-match tells which font an application gets when it asks for a
kind of font.
Install font packages
Search the packages with Spk-gui or spk-search font, then install as
root, for example:
# spk-add ttf-dejavu-extra
Some useful packages:
- ttf-dejavu-extra: the rest of DejaVu (serif, condensed, light).
- liberation-fonts: same sizes as Arial, Times New Roman and Courier New, for office documents made on Windows. croscore-fonts does the same with Arimo, Tinos and Cousine.
- noto-sans, noto-serif, noto-mono, ttf-roboto, cantarell-fonts, ubuntu-font-family: other fonts for the screen.
- ttf-open-dyslexic: a font made easier to read for dyslexic readers.
- ttf-inconsolata-dz, terminus-font: for the terminal and code.
- unifont: covers almost every script, plain but useful as a last resort.
The font packages do not update the font cache. Fontconfig finds the new fonts anyway, but every application then scans them again when it starts: update the cache once, as root, and open the application again.
# fc-cache
Other scripts: Chinese, Japanese, Korean, Greek
DejaVu covers Latin, Greek and Cyrillic. For other scripts, add a font that has them:
- Chinese: wqy-microhei, or the bitmap wqy-bitmapfont;
- Japanese: vlgothic-fonts or ipaex-fonts;
- Korean: noto-sans-kr and noto-serif-kr (x86_64 only);
- Greek: otf-gfs, more Greek typefaces.
To check that a script is covered, list the fonts that have a language, here Japanese:
$ fc-list :lang=ja family
An empty answer means no font has it: the text shows as empty boxes.
Add your own fonts
Copy the font files (.ttf or .otf) to your fonts folder, then
update the cache:
$ mkdir -p ~/.local/share/fonts
$ cp MyFont.ttf ~/.local/share/fonts/
$ fc-cache
For every user, copy them as root to a folder of their own under
/usr/share/fonts, for example /usr/share/fonts/TTF, and run
fc-cache as root. Then open the application again.
Tips
- On a live system your home is in RAM: fonts copied there are lost at reboot, unless the home is on a disk, see Keeping your files.
fc-cache -fscans every folder again, even those that look up to date.fc-query MyFont.ttfshows the name and the languages of a font file before you install it.
Troubleshooting
A new font does not show up: run fc-cache -f, then check that
fc-list | grep -i myfont lists it. Close and open the application
again: most of them read the font list only when they start.
Empty boxes instead of letters: no installed font has these characters. Add a font for this script, see above, or unifont.