Fonts
This is a home page for information about using fonts on Gentoo.
In general usage, a font is typically a file containing one or more variations of a typeface. In typographical usage, a font is a particular size, weight and style of a typeface.
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".
Font installation
A variety of fonts are provided by the media-fonts package category. Fonts provided by the gentoo repository can be listed by viewing the contents of the /var/db/repos/gentoo/media-fonts/ directory, or by using eix:
user $eix -C media-fontsmedia-fonts/fonts-meta is a meta package providing fonts to cover most needs.
media-fonts/corefonts provides Microsoft's TrueType core fonts.
Manual font installation
Global
System administrators (those with root privileges) can copy fonts into /usr/local/share/fonts. This will make fonts available to any user on the system.
root #cp /home/larry/Downloads/Inconsolata.otf /usr/local/share/fontsThe /usr/local/share/fonts directory is used to separate manually installed fonts from those installed by Portage in /usr/share/fonts.
Per-user
Users can create a .local/share/fonts directory in their home directory. Font files can then be added to that directory, or to a subdirectory of that directory:
user $mkdir -p ~/.local/share/fonts
user $cp ~/Downloads/Inconsolata.otf ~/.local/share/fonts
To make a newly-installed font available to applications, refresh the Fontconfig cache via fc-cache(1) :
user $fc-cache -fvUse 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.
Font support for specific characters
Refer to the "Writing systems" section of the Fonts/Background page for an explanation of the word glyph and related terminology.
Gentoo doesn't install many fonts by default. If an application needs to display a particular character, but the current font (or, perhaps, any font known to the application) doesn't have a glyph for it, the character will be rendered using the .notdef character, informally known as tofu. Tofu is typically displayed as either:
- an empty square, ☐;
- a box with an X in it, ☒;
- a box with a question mark in it, ⍰;
- a box containing the Unicode code point in hexadecimal.
To check if any installed font provides a glyph for a particular Unicode code point, use fc-list(1) - provided by the media-libs/fontconfig package - to list all installed fonts with such a glyph, specifying the code point in hexadecimal:
user $fc-list ':charset=3088'Noto
Google's "Noto" typeface family is an attempt to provide a single typeface with glyphs for all assigned Unicode code points, which cover most of the world's scripts; the name "Noto" is an abbreviation of "No Tofu".
On Gentoo, the Noto family is available via the media-fonts/noto (including support for Arabic, Bengali, Persian, Tamil, and Thai), media-fonts/noto-cjk (including support for Chinese, Japanese and Korean), and media-fonts/noto-emoji packages.
Once installed, Noto Emoji can be configured for use as a fallback font (used when a glyph does not exist in the selected font) for Emoji by running:
root #eselect fontconfig enable 75-noto-emoji-fallback.confNote that Web browsers tend to use their own font selection logic; often simply installing the package is sufficient.
Symbols
One option for a symbol font is Symbola, provided by the media-fonts/ttf-ancient-fonts::guru package in the GURU overlay. This font has previously been provided by the media-fonts/symbola::guru package, which is now obsolete.
Picking fonts
Many fonts don't provide glyphs for every assigned Unicode codepoint, due to the size of Unicode. If a font doesn't provide a glyph for a given codepoint, the character might be represented by a substitute character (such as a rectangle containing the hexadecimal value of the code point), or by a glyph from a different font (the "fallback font"), depending on the application.
The following are some recommendations regarding well-known fonts:
Liberation
Provided by media-fonts/liberation-fonts .
This is the Gentoo Fonts team's recommendation for default Latin fonts.
Pros:
- Red Hat's fonts.
- Metric-compatible with MS TrueType corefonts.
- Have a decent, modern look.
- Covers about 2,600 code points.
Cons:
- Latin, Greek, Cyrillic, and Hebrew only.
- A few glyphs may have hinting trouble.
ChromeOS fonts
ChromeOS core fonts, provided by media-fonts/croscorefonts , and ChromeOS extra fonts, provided by media-fonts/crosextrafonts-caladea and media-fonts/crosextrafonts-carlito .
Pros:
- Metric compatible with Microsoft corefonts and two of the ClearType fonts
- very good hinting
- includes more glyphs and languages over Liberation
Cons:
- Some packages have a hard dependency on media-fonts/corefonts or media-fonts/liberation-fonts , so in many cases users can't only install the ChromeOS fonts, unless performing some hackery via package.provided.
Linux Libertine
Provided by media-fonts/libertine .
Pros:
- Very similar to Liberation, covering about 2,700 code points.
- Linux Libertine itself is proportional serif only, but the package contains less extensive sans and mono fonts, as well.
- Can be used as a fallback for some glyphs not in Liberation.
Cons:
- Latin, Greek, Cyrillic, and Hebrew only.
- Sans and mono fonts are limited.
Noto
Provided by media-fonts/noto .
Recommended as a fallback for many glyphs not covered by Liberation.
Pros:
- Google's font family that aims to support all the world's languages (well over 60,000 code points).
- Goes well with Liberation or Droid.
- Adobe's Source Han Sans fonts are included for CJK.
Cons:
- Big download.
DejaVu
Provided by media-fonts/dejavu .
Pros:
- Many styles and covers a lot of code points (about 6,100 for sans).
Cons:
- Exceptionally wide — even condensed is wider than same-height monospace. Overall second to Verdana (an MS font) in width. Sans-serif font is only average.
Droid
Provided by media-fonts/droid .
Pros:
- Covers a lot of code points and scripts.
Cons:
- Very dry, wide yet thin glyphs. Clearly designed with handheld devices and their small screens in mind.
Gentium Plus
Provided by media-fonts/sil-gentium .
Pros:
- Fairly distinctive; might appeal to people who like narrow fonts.
Cons:
- Serif only. As with other SIL fonts, the hinting is questionable.
Ubuntu
Provided by media-fonts/ubuntu-font-family .
Pros:
- Used in Ubuntu (obviously).
- A distinctive font family with a style which might not appeal to everyone.
- Overall looks good and covers a fair number of code points.
Cons:
- Only the sans-serif font is truly polished; narrow and monospaced versions are unfinished.
- No known serif font that would accompany it well.
URW
Provided by media-fonts/urw-fonts .
Pros:
- Metric compatible with popular Adobe fonts (among others?).
Cons:
- Seem to require slight hinting.
MS TrueType corefonts
Provided by media-fonts/corefonts .
Pros:
- Includes most fonts used in documents and on the web.
Cons:
- MS does not distribute them nowadays, so the available fonts are from many years ago and do not reflect their current state (not to mention the state of the art). Obviously, lacks fonts introduced more recently.
- Require full hinting.
Unifont
Provided by media-fonts/unifont .
Pros:
- Covers a lot of code points.
Cons:
- In addition to being ugly as sin, it also fails some basic requirements to be considered a typeface. Is it sans-serif? Is it serif? Please never use this.
See also
- Fontconfig — intended to provide uniform font selection and configuration amongst all GUI applications.
- Fonts/Background — a quick and informal introduction to font-related concepts, terminology, and systems, with the aim of facilitating understanding and solving font-related issues
- Fonts/Console
- Fonts/Software — list of end-user software for working with fonts
- Localization/Guide/The_Euro_symbol — how to display the Euro symbol (€) for the console and in X.
External resources
- Font Library - Font distribution website that beautifully displays fonts.