Fonts - ArchWiki

# Fonts

From ArchWiki
Jump to navigation Jump to search

Related articles

- Font configuration
- Linux console#Fonts
- Java Runtime Environment fonts
- Metric-compatible fonts
- Microsoft fonts

From Wikipedia:Computer font: "A computer font (or font) is an electronic data file containing a set of glyphs, characters, or symbols such as dingbats."

Note that certain font licenses may impose some legal limitations.

## Font formats

Most computer fonts used today are in either bitmap or outline data formats.

Bitmap fonts
  Consist of a matrix of dots or pixels representing the image of each glyph in each face and size.
Outline or vector fonts
  Use Bézier curves, drawing instructions and mathematical formulae to describe each glyph, which make the character outlines scalable to any size.

### Bitmap formats

- Bitmap Distribution Format (BDF) by Adobe
- Portable Compiled Format (PCF) by Xorg
- PC Screen Font (PSF) used by the Kernel for console fonts, not supported by Xorg (for Unicode PSF files the extension is `psfu`)

These formats can also be gzipped. See #Bitmap for the available bitmap fonts.

### Outline formats

- PostScript fonts by Adobe – has various formats, e.g: Printer Font ASCII (PFA) and Printer Font Binary (PFB)
- TrueType by Apple and Microsoft (file extension: `ttf`)
- OpenType by Microsoft, built on TrueType (file extensions: `otf`, `ttf`)

For most purposes, the technical differences between TrueType and OpenType can be ignored.

### Other formats

The typesetting application, TeX, and its companion font software, Metafont, render characters using their own methods. Some of the file extensions used for fonts by these two programs are `*pk`, `*gf`, `mf` and `vf`.

FontForge (fontforge), a font editing application, can store fonts in its native text-based format, `sfd`, spline font database.

The SVG format also has its own font description method.

## Installation

There are various methods for installing fonts.

### Pacman

Fonts and font collections in the enabled repositories can be installed using pacman.

Available fonts may be found by querying packages (e.g. for `font` or `ttf`).

### Creating a package

You should give pacman the ability to manage your fonts, which is done by creating an Arch package. These can also be shared with the community in the AUR. The packages to install fonts are particularly similar; simply taking an existing package as template should work well. To learn about how to modify it for your font, please refer to Creating packages.

The family name of a font file can be aquired with the use of `fc-query` for example: `fc-query -f '%{family[0]}\n' /path/to/file`. The formatting is described in FcPatternFormat(3).

### Manual installation

The recommended way of adding fonts that are not in the repositories to your system is described in #Creating a package. This gives pacman the ability to remove or update them at a later time. Fonts can alternately be installed manually as well.

To install fonts system-wide (available for all users), move the folder to the `/usr/share/fonts` directory. The files need to be readable by every user, use chmod to set the correct permissions (i.e. at least `0444` for files and `0555` for directories). To install fonts for only a single user, use `~/.local/share/fonts/` (`~/.fonts/` is now deprecated).

For Xserver to load fonts directly (as opposed to the use of a font server) the directory for your newly added font must be added with a FontPath entry. This entry is located in the Files section of your Xorg configuration file (e.g. `/etc/X11/xorg.conf` or `/etc/xorg.conf`). See #Older applications for more detail.

Then update the fontconfig font cache: (usually unnecessary as software using the fontconfig library does this)

    $ fc-cache

### Older applications

With older applications that do not support fontconfig (e.g. GTK 1.x applications, and `xfontsel`) the index will need to be created in the font directory:

    $ mkfontscale
    $ mkfontdir

Or to include more than one folder with one command:

    $ for dir in /font/dir1/ /font/dir2/; do xset +fp $dir; done && xset fp rehash

Or if fonts were installed in a different sub-folders under the e.g. `/usr/share/fonts`:

    $ for dir in * ; do if [  -d  "$dir"  ]; then cd "$dir";xset +fp "$PWD" ;mkfontscale; mkfontdir;cd .. ;fi; done && xset fp rehash

At times the X server may fail to load the fonts directory and you will need to rescan all the `fonts.dir` files:

    # xset +fp /usr/share/fonts/misc # Inform the X server of new directories
    # xset fp rehash                # Forces a new rescan

To check that the font(s) is included:

    $ xlsfonts | grep fontname

Note: Many packages will automatically configure Xorg to use the font upon installation. If that is the case with your font, this step is not necessary.

This can also be set globally in `/etc/X11/xorg.conf` or `/etc/X11/xorg.conf.d`.

Here is an example of the section that must be added to `/etc/X11/xorg.conf`. Add or remove paths based on your particular font requirements.

    # Let X.Org know about the custom font directories
    Section "Files"
        FontPath    "/usr/share/fonts/100dpi"
        FontPath    "/usr/share/fonts/75dpi"
        FontPath    "/usr/share/fonts/cantarell"
        FontPath    "/usr/share/fonts/cyrillic"
        FontPath    "/usr/share/fonts/encodings"
        FontPath    "/usr/share/fonts/misc"
        FontPath    "/usr/share/fonts/truetype"
        FontPath    "/usr/share/fonts/TTF"
        FontPath    "/usr/share/fonts/util"
    EndSection

### Pango Warnings

When Pango is in use on your system it will read from fontconfig to sort out where to source fonts.

    (process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='common'
    (process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='latin'

If you are seeing errors similar to this and/or seeing blocks instead of characters in your application then you need to add fonts and update the font cache. This example uses the ttf-liberation fonts to illustrate the solution (after successful installation of the package) and runs as root to enable them system-wide.

    # fc-cache

    /usr/share/fonts: caching, new cache contents: 0 fonts, 3 dirs
    /usr/share/fonts/TTF: caching, new cache contents: 16 fonts, 0 dirs
    /usr/share/fonts/encodings: caching, new cache contents: 0 fonts, 1 dirs
    /usr/share/fonts/encodings/large: caching, new cache contents: 0 fonts, 0 dirs
    /usr/share/fonts/util: caching, new cache contents: 0 fonts, 0 dirs
    /var/cache/fontconfig: cleaning cache directory
    fc-cache: succeeded

You can test for a default font being set like so:

    $ fc-match

    LiberationMono-Regular.ttf: "Liberation Mono" "Regular"

## Font packages

This is a selective list that includes many font packages from the AUR along with those in the official repositories. Fonts are tagged "Unicode" if they have wide Unicode support, see the project or Wikipedia pages for detail.

The Archfonts Python script can be used to generate an overview of all the TTF fonts found in the official repositories / the AUR (the image generation is done using ttf2pngAUR).

### Bitmap

Note: pango 1.44 dropped support for FreeType in favor or HarfBuzz thus losing support for bitmap fonts, so applications like e.g. gnome-terminal will not work with such fonts anymore, showing rectangles instead of glyphs. See FS#63297, Pango issue #386 and HarfBuzz issue #1897.

- Default 8x16
- Dina (dina-font) – 6pt, 8pt, 9pt, 10pt, monospaced, based on Proggy
- Efont (efont-unicode-bdfAUR) – 10px, 12px, 14px, 16px, 24px, normal, bold and italic
- Gohu (gohufontAUR) – 11px, 14px, normal and bold
- Lime (artwiz-fontsAUR)
- ProFont (ttf-profont-iixAUR) – 10px, 11px, 12px, 15px, 17px, 22px, 29px, normal
- Proggy (proggyfontsAUR) – has different variants
- Tamsyn (tamsyn-font)
- Terminus (terminus-font) (terminus-font-otb) - OpenType Bitmap (OTB) variant works with Pango 1.44
- Tewi (bdf-tewi-gitAUR)
- Unifont (most extensive Unicode coverage of any font) (bdf-unifont)

### Latin script

#### Families

- Luxi fonts (font-bh-ttf) – X.Org Luxi fonts
- Bitstream Vera (ttf-bitstream-vera) – serif, sans-serif, and monospace
- Courier Prime (ttf-courier-primeAUR) – Courier font alternative optimized for screenplays
- Croscore fonts (ttf-croscore) – Google's substitute for Windows' Arial, Times New Roman, and Courier New
- DejaVu fonts (ttf-dejavu) – Bitstream Vera modified for greater Unicode coverage
- Droid (ttf-droid) – default font for older Android versions
- Roboto (ttf-roboto) – default font for newer Android versions
- Google Noto (noto-fonts) – Unicode
- Liberation fonts (ttf-liberation) – free metric-compatible substitute for the Arial, Arial Narrow, Times New Roman and Courier New fonts found in Windows and Microsoft Office products
- Ubuntu Font Family (ttf-ubuntu-font-family)
- Microsoft fonts (ttf-ms-win10AUR) – Windows 10 fonts

Legacy Microsoft font packages:

- Microsoft fonts (ttf-ms-fontsAUR) – Andalé Mono, Courier New, Arial, Arial Black, Comic Sans, Impact, Lucida Sans, Microsoft Sans Serif, Trebuchet, Verdana, Georgia, Times New Roman
- Vista fonts (ttf-vista-fontsAUR) – Consolas, Calibri, Candara, Corbel, Cambria, Constantia

#### Monospaced

For more monospaced fonts see #Bitmap and #Families.

- Anonymous Pro (ttf-anonymous-pro, included in ttf-google-fonts-gitAUR)
- Envy Code R (ttf-envy-code-rAUR)
- Fantasque Sans Mono (ttf-fantasque-sans-mono, otf-fantasque-sans-mono)
- Fira Mono (ttf-fira-mono, otf-fira-mono) – designed for Firefox OS
- Fira Code (ttf-fira-code, otf-fira-code) – with programming ligatures
- FreeMono (gnu-free-fonts) - Unicode
- Hack (ttf-hack) - an open source monospaced font, used as the default in KDE Plasma
- Inconsolata (ttf-inconsolata, included in ttf-google-fonts-gitAUR) - inspired by Consolas
- Inconsolata-g (ttf-inconsolata-gAUR) - adds some programmer-friendly modifications
- Iosevka (ttf-iosevkaAUR) – slender sans-serif and slab-serif typeface inspired by Pragmata Pro, M+ and PF DIN Mono, designed to be the ideal font for programming; it supports programming ligatures and over 2000 latin, greek, cyrillic, phonetic and PowerLine glyphs
- Lucida Typewriter (included in package jreAUR)
- Menlo (derivative: ttf-mesloAUR) - default monospaced font of OS X
- Monaco (ttf-monacoAUR) - proprietary font designed by Apple for OS X
- Monofur (ttf-monofurAUR)
- Mononoki (ttf-mononokiAUR)
- Source Code Pro (adobe-source-code-pro-fonts, included in ttf-google-fonts-gitAUR)

Relevant websites:

- Dan Benjamin's Top 10 Programming Fonts.
- Trevor Lowing's font list
- Slant: What are the best programming fonts?
- Stack Overflow: Recommended fonts for programming

#### Sans-serif

- Andika (ttf-andikaAUR)
- FreeSans (gnu-free-fonts) - Unicode
- Inter UI (ttf-inter-uiAUR) – designed for user interfaces
- Linux Biolinum (ttf-linux-libertine) – free substitute for Times New Roman
- PT Sans (ttf-google-fonts-gitAUR) - 3 major variations: normal, narrow, and caption - Unicode: Latin, Cyrillic
- Source Sans Pro (adobe-source-sans-pro-fonts)
- Tahoma (ttf-tahomaAUR)

#### Serif

- EB Garamond (otf-eb-garamondAUR)
- FreeSerif (gnu-free-fonts) - Unicode
- Gentium (ttf-gentium) - Unicode: Latin, Greek, Cyrillic, Phonetic Alphabet
- Linux Libertine (ttf-linux-libertine) - Unicode: Latin, Greek, Cyrillic, Hebrew

#### Unsorted

This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.

Reason: This section should be absorbed into the Monospace/Serif/Sans-Serif structure (Discuss in Talk:Fonts#)

- ttf-cheapskateAUR - Font collection from dustismo.com
- ttf-junicode - Junius font containing almost complete medieval latin script glyphs
- ttf-mph-2b-damaseAUR - Covers full plane 1 and several scripts
- xorg-fonts-type1 - IBM Courier and Adobe Utopia sets of PostScript fonts
- all-repository-fontsAUR - Meta package for all fonts in the official repositories.
- ttf-google-fonts-gitAUR - a huge collection of free fonts (including Ubuntu, Inconsolata, Roboto, etc.) - Note: Your font dialog might get very long as >100 fonts will be added.

### Non-latin scripts

#### Ancient Scripts

- ttf-ancient-fontsAUR - Font containing Unicode symbols for Aegean, Egyptian, Cuneiform, Anatolian, Maya, and Analecta scripts

#### Arabic

- ttf-amiriAUR - A classical Arabic typeface in Naskh style poineered by Amiria Press
- ttf-arabeyes-fontsAUR - Collection of free Arabic fonts
- ttf-qurancomplex-fontsAUR - Fonts by King Fahd Glorious Quran Printing Complex in al-Madinah al-Munawwarah
- ttf-sil-lateefAUR - Unicode Arabic font from SIL
- ttf-sil-scheherazadeAUR - Unicode Arabic font from SIL (Alternative for Traditional Arabic font)

#### Braille

- ttf-ubrailleAUR - Font containing Unicode symbols for braille

#### Chinese, Japanese, Korean, Vietnamese

##### Pan-CJK

- Adobe Source Han fonts - Large collection of fonts which comprehensively support Simplified Chinese, Traditional Chinese, Japanese, and Korean, with a consistent design and look.
  - adobe-source-han-sans-otc-fonts - Sans fonts
  - adobe-source-han-serif-otc-fonts - Serif fonts
- noto-fonts-cjk - Large collection of fonts which comprehensively support Simplified Chinese, Traditional Chinese, Japanese, and Korean, with a consistent design and look. It is currently a rebadged version of adobe-source-han-sans-otc-fonts.

##### Chinese

This article or section is a candidate for moving to Localization/Chinese#Fonts.

Notes: It makes sense to group language-specific things together. (Discuss in Talk:Fonts#Move CJK and Indic fonts to Localization subpages)

- adobe source han fonts
  - adobe-source-han-sans-cn-fonts - Simplified Chinese OpenType/CFF Sans fonts
  - adobe-source-han-sans-tw-fonts - Traditional Chinese OpenType/CFF Sans fonts
  - adobe-source-han-serif-cn-fonts - Simplified Chinese OpenType/CFF Serif fonts
  - adobe-source-han-serif-tw-fonts - Traditional Chinese OpenType/CFF Serif fonts
- noto Chinese fonts
  - noto-fonts-scAUR - Noto CJK-SC fonts for Simplified Chinese
  - noto-fonts-tcAUR - Noto CJK-TC fonts for Traditional Chinese
- wqy fonts
  - wqy-microhei - WenQuanYi Micro Hei font family (also known as Hei, Gothic or Dotum) is a sans-serif style derived from Droid Sans Fallback, it offers high quality CJK outline font and it is extremely compact (~5M).
  - wqy-zenhei - Hei Ti Style (sans-serif) Chinese Outline font embedded with bitmapped Song Ti (also supporting Japanese (partial) and Korean characters).
  - wqy-bitmapfont - Bitmapped Song Ti (serif) Chinese font.
- arphic fonts
  - ttf-arphic-ukai - Kaiti (brush stroke) Unicode font (enabling anti-aliasing is suggested)
  - ttf-arphic-uming - Mingti (printed) Unicode font
- opendesktop-fonts - New Sung font, previously is ttf-fireflysung package
- ttf-hannom - Chinese and Vietnamese ttf fonts
- Standart fonts of the Republic of China ministry of education in Taiwan
  - ttf-twAUR - Kai and Song traditional Chinese font from the Ministry of Education of Taiwan
  - ttf-twcns-fontsAUR Chinese TrueType fonts by Ministry of Education of Taiwan government, support CNS11643 standard, including Kai and Sung fontface.
- Windows Chinese fonts
  - ttf-ms-win8-zh_cnAUR - windows8 simple Chinese fonts。
  - ttf-ms-win8-zh_twAUR - windows8 traditional Chinese fonts。
  - ttf-ms-win10-zh_cnAUR - windows10 simple Chinese fonts。
  - ttf-ms-win10-zh_twAUR - windows10 traditional Chinese fonts。
- ttf-i.bmingAUR - CJK serif font that emphasis on an old-style typeface.

##### Japanese

This article or section is a candidate for moving to Localization/Japanese#Fonts.

Notes: It makes sense to group language-specific things together. (Discuss in Talk:Fonts#Move CJK and Indic fonts to Localization subpages)

- adobe-source-han-sans-jp-fonts - Japanese OpenType/CFF fonts
- otf-ipafont - Formal style Japanese Gothic (sans-serif) and Mincho (serif) fonts set; one of the highest quality open source font. Default of openSUSE-ja.
- ttf-hanazono - A free Japanese kanji font, style Mincho (serif).
- ttf-sazanami - Japanese free TrueType font. This is outdated and not maintained any more, but may be defined as a fallback font on several environments.
- ttf-koruriAUR - Japanese TrueType font obtained by mixing ttf-mplusAUR and Open Sans
- ttf-monapoAUR - Japanese fonts to show 2channel Shift JIS art properly.
- ttf-mplusAUR - Modern Gothic style Japanese outline fonts. It includes all of Japanese Hiragana/Katakana, Basic Latin, Latin-1 Supplement, Latin Extended-A, IPA Extensions and most of Japanese Kanji, Greek, Cyrillic, Vietnamese with 7 weights (proportional) or 5 weights (monospace).
- ttf-vlgothicAUR - Japanese Gothic fonts. Default of Debian/Fedora/Vine Linux

##### Korean

This article or section is a candidate for moving to Localization/Korean#Fonts.

Notes: It makes sense to group language-specific things together. (Discuss in Talk:Fonts#Move CJK and Indic fonts to Localization subpages)

- adobe-source-han-sans-kr-fonts - Korean OpenType/CFF fonts
- ttf-baekmuk - Collection of Korean TrueType fonts
- spoqa-han-sansAUR - Source Han Sans customized by Spoqa
- ttf-d2codingAUR - D2Coding fixed width TrueType font made by Naver
- ttf-nanumAUR - Nanum series TrueType fonts
- ttf-nanumgothic_codingAUR - Nanum series fixed width TrueType fonts
- ttf-kopubAUR/otf-kopubAUR - Korean TrueType/OpenType fonts by Korea Publisher Society
- ttf-kopubworldAUR/otf-kopubworldAUR - Multilingual (Korean, Yethangul, Chinese extended, Japanese, Latin extended, Cyrillic, Arabic, Hebrew, Devanagari) TrueType/OpenType fonts by Korea Publisher Society
- ttf-unfonts-core-ibxAUR - A collection of Korean TrueType fonts by KLDP

##### Vietnamese

- ttf-hannom - Vietnamese TrueType font for chữ Nôm characters

#### Cyrillic

See also #Latin script.

- ttf-paratypeAUR - Font family by ParaType: sans, serif, mono, extended cyrillic and latin, OFL license
- otf-russkopisAUR - A free OpenType cursive font for Cyrillic script

#### Greek

Almost all Unicode fonts contain the Greek character set (polytonic included). Some additional font packages, which might not contain the complete Unicode set but utilize high quality Greek (and Latin, of course) typefaces are:

- otf-gfsAUR - Selection of OpenType fonts from the Greek Font Society
- ttf-mgopenAUR - Professional TrueType fonts from Magenta

#### Hebrew

- opensiddur-hebrew-fontsAUR - Large collection of Open-source licensed Hebrew fonts
- culmusAUR - Nice collection of free Hebrew fonts

#### Indic

This article or section is a candidate for moving to Localization/Indic#Fonts.

Notes: It makes sense to group language-specific things together. (Discuss in Talk:Fonts#Move CJK and Indic fonts to Localization subpages)

- ttf-freebanglafontAUR - Font for Bangla
- ttf-indic-otf - Indic OpenType Fonts collection (containing ttf-freebanglafont), provides the character U+0CA0 "ಠ"
- lohit-fontsAUR - Indic TrueType fonts from Fedora Project (containing Oriya Fonts and more)
- ttf-devanagarifontsAUR - Devanagari TrueType fonts (contains 283 fonts)
- ttf-gurmukhi-fonts_sikhnetAUR - TrueType Gurmukhi fonts (gurbaniwebthick,prabhki)
- ttf-gurmukhi_punjabiAUR - TTF Gurmukhi / Punjabi (contains 252 fonts)
- ttf-gujrati-fontsAUR - TTF Gujarati fonts (Avantika,Gopika,Shree768)
- ttf-kannada-fontAUR - Kannada, the language of Karnataka state in India
- ttf-lklugAUR - Sinhala Unicode font
- ttf-tamilAUR - Tamil Unicode fonts
- ttf-urdufontsAUR - Urdu fonts (Jameel Noori Nastaleeq (+kasheeda), Nafees Web Naskh, PDMS Saleem Quran Font) and font configuration to set Jameel Noori Nastaleeq as default font for Urdu
- fonts-smc-malayalamAUR - Malayalam Unicode Fonts released by 'Swathanthra Malayalam Computing' (contains 11 fonts).

#### Khmer

- ttf-khmer - Font covering glyphs for Khmer language
- Hanuman (ttf-google-fonts-gitAUR)

#### Mongolic and Tungusic

- ttf-abkaiAUR - Fonts for Sibe, Manchu and Daur scripts (incomplete, currently in development)

#### Persian

- persian-fontsAUR - Meta package for installing all Persian fonts in AUR.
- borna-fontsAUR - Borna Rayaneh Co. Persian B font series.
- iran-nastaliq-fontsAUR - A free Unicode calligraphic Persian font.
- iranian-fontsAUR - Iranian-Sans and Iranian-Serif Persian font family.
- ir-standard-fontsAUR - Iran Supreme Council of Information and Communication Technology (SCICT) standard Persian fonts.
- persian-hm-ftx-fontsAUR - A Persian font series derived from X Series 2, Metafont and FarsiTeX fonts with Kashida feature.
- persian-hm-xs2-fontsAUR - A Persian font series derived from X Series 2 fonts with Kashida feature.
- sina-fontsAUR - Sina Pardazesh Co. Persian font series.
- gandom-fontsAUR, parastoo-fontsAUR, sahel-fontsAUR, samim-fontsAUR, shabnam-fontsAUR, tanha-fontsAUR, vazir-fontsAUR, vazir-code-fontsAUR - Beautiful Persian fonts made by Ali Rasti Kerdar.
- ttf-yasAUR - The Yas Persian font series (with hollow zero).
- ttf-x2AUR - Free fonts with support for Persian, Arabic, Urdu, Pashto, Dari, Uzbek, Kurdish, Uighur, old Turkish (Ottoman) and modern Turkish (Roman).

#### Tai–Kadai

- fonts-tlwgAUR - Collection of scalable Thai fonts
- ttf-laoAUR - Lao TTF font (Phetsarath_OT)
- ttf-lao-fontsAUR - Lao TTF fonts, both Unicode and non-Unicode for Windows

#### Tibeto-Burman

- ttf-tibetan-machine - Tibetan Machine TTFont
- ttf-myanmar-fontsAUR - 121 Fonts from myordbok.com

### Emoji and symbols

A section of the Unicode standard is designated for pictographic characters called "emoji".

- noto-fonts-emoji - Google's own emoji font, like on Android or Google Hangouts.
- ttf-symbolaAUR - provides many Unicode symbols, including emoji, in outline style.
- ttf-joypixels - Unicode 12 compliant Emoji font (formerly EmojiOne)
- ttf-twemoji-colorAUR - Twitter's open-sourced emoji glyphs.

Kaomoji are sometimes referred to as "Japanese emoticons" and are composed of characters from various character sets, including CJK and Indic fonts. For example, the following set of packages covers most of existing kaomoji: gnu-free-fonts, ttf-arphic-uming, and ttf-indic-otf.

### Math

- font-mathematica - Mathematica fonts by Wolfram Research, Inc.
- texlive-core and texlive-fontsextra contain many math fonts such as Latin Modern Math and STIX Fonts. See TeX Live#Making fonts available to Fontconfig for configuration.
- otf-stixAUR - A standalone, more recent version of STIX
- otf-latin-modern, otf-latinmodern-math - Improved version of Computer Modern fonts as used in LaTeX
- ttf-computer-modern-fontsAUR, otf-cm-unicodeAUR - Computer Modern (of TeX fame)
- ttf-mathtypeAUR - MathType fonts

### Other operating system fonts

- ttf-mac-fontsAUR - Apple MacOS TrueType fonts

See Metric-compatible fonts, which lists available alternatives for Microsoft fonts.

## Fallback font order with X11

Fontconfig automatically chooses a font that matches the current requirement. That is to say, if one is looking at a window containing English and Chinese for example, it will switch to another font for the Chinese text if the default one does not support it.

Fontconfig lets every user configure the order they want via `$XDG_CONFIG_HOME/fontconfig/fonts.conf`. If you want a particular Chinese font to be selected after your favorite Serif font, your file would look like this:

    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>
    <alias>
       <family>serif</family>
       <prefer>
         <family>Your favorite Latin Serif font name</family>
         <family>Your Chinese font name</family>
       </prefer>
     </alias>
    </fontconfig>

Tip: If you use a Chinese locale, set `LC_LANG` to `und` to make this work. Otherwise both English and Chinese text will be rendered in the Chinese font.

You can add a section for sans-serif and monospace as well. For more information, have a look at the fontconfig manual.

See also Font configuration#Replace or set default fonts.

## Font alias

There are several font aliases which represent other fonts in order that applications may use similar fonts. The most common aliases are: `serif` for a font of the serif type (e.g. DejaVu Serif); `sans-serif` for a font of the sans-serif type (e.g. DejaVu Sans); and `monospace` for a monospaced font (e.g. DejaVu Sans Mono). However, the fonts which these aliases represent may vary and the relationship is often not shown in font management tools, such as those found in KDE and other desktop environments.

To reverse an alias and find which font it is representing, run:

    $ fc-match monospace

    DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"

In this case, `DejaVuSansMono.ttf` is the font represented by the monospace alias.

## Tips and tricks

### List all installed fonts

You can use the following command to list all installed Fontconfig fonts that are available on your system.

    $ fc-list

### List installed fonts for a particular language

Applications and browsers select and display fonts depending upon fontconfig preferences and available font glyph for Unicode text. To list installed fonts for a particular language, issue a command `fc-list :lang="two letter language code"`. For instance, to list installed Arabic fonts or fonts supporting Arabic glyph:

    $ fc-list -f '%{file}\n' :lang=ar

    /usr/share/fonts/TTF/FreeMono.ttf
    /usr/share/fonts/TTF/DejaVuSansCondensed.ttf
    /usr/share/fonts/truetype/custom/DroidKufi-Bold.ttf
    /usr/share/fonts/TTF/DejaVuSansMono.ttf
    /usr/share/fonts/TTF/FreeSerif.ttf

### List installed fonts for a particular Unicode character

To search for monospace fonts supporting a particular Unicode codepoint:

    $ fc-match -s monospace:charset=1F4A9

### Set terminal font on-the-fly

This article or section needs expansion.

Reason: Where is the documentation for the escape codes? (Discuss in Talk:Fonts#)

For terminal emulators that use X resources, e.g. xterm or rxvt-unicode, fonts can be set by using escape sequences. Specifically, `echo -e "\033]710;$font\007"` to change the normal font (`*font` in `~/.Xresources`), and replace `710` with `711`, `712`, and `713` to change the `*boldFont`, `*italicFont`, and `*boldItalicFont`, respectively.

`$font` uses the same syntax as in `~/.Xresources` and can be anything the terminal emulator will support. (Example: `xft:dejavu sans mono:size=9`)

### Application-specific font cache

Matplotlib (python-matplotlib or python2-matplotlib) uses its own font cache, so after updating fonts, be sure to remove `~/.matplotlib/fontList.cache`, `~/.cache/matplotlib/fontList.cache`, `~/.sage/matplotlib-1.2.1/fontList.cache`, etc. so it will regenerate its cache and find the new fonts [1].

## See also

- State of Text Rendering
- Font Library - Fonts under Free licenses
- Fonts on screenshots.debian.net

Category:

- Fonts

Hidden categories:

- Pages or sections flagged with Template:Style
- Pages or sections flagged with Template:Move
- Pages or sections flagged with Template:Expansion