Fonts
Fonts are a core part of the system and are necessary in order to represent text on a display.
The best starting point for general information about configuration, use and management of fonts on Gentoo, particularly for software running under X or a Wayland compositor (including terminal emulators), is the Fontconfig page.
Additionally:
- For information about configuring fonts for the Linux console specifically (rather than for GUI-based terminal emulators), refer to the Fonts/Console page.
- For information about software for working with fonts, refer to the Fonts/Software page.
- For background on font-related concepts, terminology, and systems (e.g. Unicode), refer to the Fonts/Background page.
- For a high-level introduction to the systems involved in displaying text on Linux, refer to the external article "Modern text rendering with Linux: Overview".
Home directory
When installing fonts on a local basis, each user can create a .local/share/fonts directory in their home directory. This directory can then be filled with font files:
user $
mkdir -p ~/.local/share/fonts
user $
cp ~/Downloads/Inconsolata.otf ~/.local/share/fonts
To make a newly-installed font available, refresh the Fontconfig cache via fc-cache(1):
user $
fc-cache -fv
Use an application such as a terminal emulator or an office program to confirm that the font is now available.
Historically, the ~/.fonts directory was used to store fonts on a per-user basis. The modern equivalent is ~/.local/share/fonts.
Fonts can also be installed in a subfolder of the ~/.local/share/fonts directory.
Globally available
System administrators (those with root privileges) can copy fonts into the system's /usr/local/share/fonts directory. This will make fonts available to any user on the system.
root #
cp /home/larry/Downloads/Inconsolata.otf /usr/local/share/fonts
Font installation to support viewing more scripts
Emoji and symbols
root #
emerge --ask media-fonts/noto-emoji
Once installed, Noto Emoji can be configured selected for use as a fallback font (used when a glyph does not exist in the selected font) for emoji symbols using the following command:
root #
eselect fontconfig enable 75-noto-emoji-fallback.conf
Currently available through the GURU overlay:
root #
emerge --ask media-fonts/symbola
Non-Latin scripts
Gentoo doesn't install many fonts by default; if a character needs to be displayed that the system does not have a glyph for it will be rendered using the .notdef character also known as tofu this is typically:
- a little square which is often empty, ☐
- a box with an X in it, ☒
- a box with a question mark in it, ⍰
- a box containing the unicode code point
The web browser used to view this page renders it as .
The Noto (no tofu) font family provides a single (if large) package that contains a consistent set of glyphs covering most commonly used languages.
If support for additional glyphs is required consider installing a selection of the following packages:
Language | Package(s) |
---|---|
Arabic | media-fonts/arabeyes-fonts media-fonts/noto |
Bengali | media-fonts/lohit-bengali media-fonts/noto |
Japanese | media-fonts/mikachan-font-ttf media-fonts/noto-cjk |
Korean | media-fonts/alee-fonts media-fonts/noto-cjk |
Persian | media-fonts/farsi-fonts media-fonts/noto |
Tamil | media-fonts/lohit-tamil media-fonts/noto |
Thai | media-fonts/thaifonts-scalable media-fonts/noto |
Non-latin font in TTY (in for example Ctrl-Alt-F2)
See available fonts in /usr/share/consolefonts/
For example, you want to fix the output of Cyrillic text in TTY:
# If tty (without X)
if [[ "$TERM" = "linux" ]]; then
setfont cyr-sun16
# Without this - I see tofu (squares) on Cyrillic output from translate-shell
fi
Additional package considerations
media-fonts/fonts-meta (Meta package for fonts to cover most needs):
root #
emerge --ask media-fonts/fonts-meta
Microsoft's TrueType media-fonts/corefonts:
root #
emerge --ask media-fonts/corefonts
See also
- About Picking fonts in the Fontconfig docs
- Localization/Guide/The_Euro_symbol — how to display the Euro symbol (€) for the console and in X.
External resources
- https://fontlibrary.org/ - A font distribution website that beautifully displays fonts.