# Fonts

For most desktop environments, a sufficient number of fonts is installed as dependencies. However, there's several additional packages for different styles and writing systems (latin vs. non-latin scripts). [Arch Wiki](https://wiki.archlinux.org/title/Fonts) has an extensive list of available fonts in both the repositories and the AUR. Installing the Noto font family also provides a vast coverage over a large array of scripts.

## Configuration

Most applications read the font configuration provided by the `fontconfig` library. These configurations are written in XML and read from several different locations.

| Location                                 | Description                                                                           |
|------------------------------------------|---------------------------------------------------------------------------------------|
| `/etc/fonts/fonts.conf`                  | Master configuration file **(not for editing!)**                                      |
| `/etc/fonts/conf.d`                      | System-wide additional drop-in configuration files, hand-written or as symbolic links |
| `$XDG_CONFIG_HOME/fontconfig/fonts.conf` | Per-user config file                                                                  |
| `$XDG_CONFIG_HOME/fontconfig/conf.d`     | Per-user additional drop-in configuration files, hand-written or as symbolic links    |

Configuration files are read in and applied in lexical order. If you need rules applied in a specific order, make sure to prepend them with 2-digit numbers in the order you need.

A minimal `fontconfig` configuration file contains these headers:

~~~xml
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>

  <!-- settings go here -->

</fontconfig>
~~~

Some font packages come with pre-defined rule sets, which are installed to `/usr/share/fontconfig/conf.avail/`. To apply them, it's best to create symbolic links to them in their respective drop-in configuration directories.

To apply them system-wide, link them from the `/etc/fonts/conf.d` directory:

~~~bash
cd /etc/fonts/conf.d
sudo ln -s /usr/share/fontconfig/conf.avail/70-no-bitmaps-except-emoji.conf
~~~

To apply them only to the currently logged in user, link them in the `$XDG_CONFIG_HOME/fontconfig/conf.d` directory:

<p class="callout info"><strong>HINT:</strong> The environment variable <code>$XDG_CONFIG_HOME</code> should point to the <code>.config</code> sub-directory in your home directory. If it doesn't, use <code>$HOME/.config</code> instead for the examples or set it with <code>export</code>.</p>

~~~bash
mkdir $XDG_CONFIG_HOME/fontconfig/conf.d
ln -s /usr/share/fontconfig/conf.avail/70-no-bitmaps-except-emoji.conf $XDG_CONFIG_HOME/fontconfig/conf.d
~~~

## Emoji Fonts

There are a few emoji fonts available on Arch.

| Name                               | Package             | Description                                                |
|------------------------------------|---------------------|------------------------------------------------------------|
| [JoyPixels][twemoji]               | `ttf-joypixels`     | formerly EmojiOne, part of Emoji as a Service, proprietary |
| [Noto Color Emoji][noto-emoji]     | `noto-fonts-emoji`  | Google open-source emoji font, color                       |
| [Twemoji (Twitter Emoji)][twemoji] | `ttf-twemoji` (AUR) | Emoji for everyone, originally created by Twitter          |

[joypixels]: https://joypixels.com/emoji
[noto-emoji]: https://fonts.google.com/noto/specimen/Noto+Color+Emoji/glyphs
[twemoji]: https://github.com/jdecked/twemoji

Install your selected emoji font:

~~~bash
pacman -S noto-fonts-emoji
~~~

Applications requesting emoji to be displayed should pick up on the font after restarting them.

<p class="callout info"><strong>NOTE:</strong> KDE sometimes applies emoji fonts incorrectly, either not showing them at all or showing the outline symbol version from a different font. You can fix this by installing <code>noto-color-emoji-fontconfig</code> from the AUR and creating a symbolic link to the configuration file as shown above.</p>