Fonts are a core part of the system and are necessary in order to represent text on a display.
Font installation in Gentoo is handled much like other distributions. It can be as easy as copying the font file into the proper directory. Other methods, such as fontconfig are also possible.
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:
mkdir -p ~/.local/share/fonts
cp ~/Downloads/Inconsolata.otf ~/.local/share/fonts
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.
Check in a few applications to see if the newly copied font has been made available. A terminal emulator or an office program should work nicely for this purpose.
System administrators (those with root privileges) can copy fonts into the system's /usr/share/fonts directory. This will make fonts available to any user on the system.
cp /home/larry/Downloads/Inconsolata.otf /usr/share/fonts
In order to use a specific font in the console, set the consolefont variable in /etc/conf.d/consolefont to the name of a file found in /usr/share/consolefonts/ (without the .psfu.gz suffix).
Next add consolefont init script to boot runlevel:
rc-update add consolefont boot
If you need bigger fonts and more modern looking fonts for HD screens you should install media-fonts/terminus-font. It has fonts with sizes from 12 to 32 pixels.
To configure fonts for use in graphical applications see the Fontconfig article.
Font installation to support viewing more scripts
Emoji and symbols
emerge --ask media-fonts/noto-emoji
Currently available through the GURU overlay:
emerge --ask media-fonts/symbola
Gentoo doesn't install many fonts by default so some characters in some languages may look like squares. If full support of viewing all languages and characters is needed, install the fonts for the following languages.
Additional package considerations
emerge --ask media-fonts/noto
media-fonts/fonts-meta (Meta package for fonts to cover most needs):
emerge --ask media-fonts/fonts-meta
Microsoft's TrueType media-fonts/corefonts:
emerge --ask media-fonts/corefonts
Configuring fonts in applications
The way programs handle fonts can be different for every program. But most applications follow a certain convention. They accept the name of the font as a variable for their font configuration. The following command will give the list of all fonts that are currently available to the user issuing it (all fonts in ~/.local/share/fonts and /usr/share/fonts).
... /usr/share/fonts/FiraCode-Medium.ttf: Fira Code,Fira Code Medium:style=Medium,Regular ...
Here, the first field after the
Fira Code in this case) is the family of the font that should be used in the configuration of most applications.
- About Picking fonts in the Fontconfig docs
- Localization/Guide/The_Euro_symbol — how to display the Euro symbol (€) for the console and in X.
- https://fontlibrary.org/ - A font distribution website that beautifully displays fonts.