Fonts

From Wikipedia:Computer font: "A computer font is implemented as a digital data file containing a set of graphically related glyphs. A computer font is designed and created using a font editor. A computer font specifically designed for the computer screen, and not for printing, is a screen font."

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

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, traditionally renders characters using its own methods. Some file extensions used for fonts from these two programs are *pk, , and . Modern versions can also use TrueType and OpenType fonts.

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; see Font packaging guidelines.

The family name of a font file can be aquired with the use of for example: . The formatting is described in .

Manual installation

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

Alternatively, fonts can be installed manually:

  • For a single user, install fonts to .
    • In many cases this suffices, unless you run graphical applications as other users.
    • In the past was used, but is now deprecated.
  • For system-wide (all users) installation, place your fonts under .
    • You may need to create the directory first: .
    • is under the purview of the package manager, and should not be modified manually.

The creation of a subdirectory structure is up to the user, and varies among Linux distributions. For clarity, it is good to keep each font in its own directory. Fontconfig will search its default paths recursively, ensuring nested files get picked up.

An example structure might be:

/usr/local/share/fonts/
├── otf
│   └── SourceCodeVariable
│       ├── SourceCodeVariable-Italic.otf
│       └── SourceCodeVariable-Roman.otf
└── ttf
    ├── AnonymousPro
    │   ├── Anonymous-Pro-B.ttf
    │   ├── Anonymous-Pro-I.ttf
    │   └── Anonymous-Pro.ttf
    └── CascadiaCode
        ├── CascadiaCode-Bold.ttf
        ├── CascadiaCode-Light.ttf
        └── CascadiaCode-Regular.ttf

The font files need to have sufficient read permissions for all users, i.e. at least chmod 444 for files, and for directories.

For the 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. or ). See #Older applications for more detail.

Finally, update the fontconfig 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 ) 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. :

$ 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 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

This can also be set globally in or .

Here is an example of the section that must be added to . Add or remove paths based on your particular font requirements.

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.

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.

Bitmap

Works with Pango 1.44:

Families

Packages providing a base font set:

Packages not providing a base font set:

  • B612 () – Open source font family (sans and mono) sponsored by Airbus, designed for comfort of reading on aircraft cockpit screens
  • Ghostscript () – The Ghostscript fonts donated by URW, includes clones of Helvetica, Times, Courier, and others. GNU FreeFont () and TeX Gyre fonts (tex-gyre-fonts) are both partially based on the Ghostscript fonts
  • Luxi fonts () – X.Org font family similar to Lucida
  • Roboto () – Default font for newer Android versions where it is complemented by Noto fonts for languages not supported like CJK
  • TeX Gyre fonts (tex-gyre-fonts) – Created by the Polish GUST association of TeX users, mostly based on URW Ghostscript fonts, includes clones of Helvetica, Times, Courier, and others. Some have their own math companion fonts, see #Math.
  • Ubuntu font family ()

Legacy Microsoft font packages:

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

Monospaced

Fonts supporting programming ligatures are identified below with a ⟶ sign. For more monospaced fonts, also see #Bitmap and #Families.

  • Anonymous Pro (, included in ttf-google-fonts-gitAUR)
  • Cascadia Code () ⟶ – Designed to enhance the look of the Windows Terminal, with programming ligatures, released by Microsoft under the Open Font License.
  • Courier Prime () – Courier alternative which has been supplemented by a sans serif font and a version optimized for programming, released under the Open Font License.
  • Envy Code R (ttf-envy-code-rAUR) – Font designed for programmers
  • Fantasque Sans Mono (, )
  • Fira Mono (, ) – Font optimized for small screens and adopted by Mozilla for the Firefox OS
  • Fira Code () ⟶ – Extension of Fira Mono with programming ligatures for common programming multi-character combinations
  • Hack () - Open source monospaced font, used as the default in KDE Plasma
  • Hasklig () - A code font with monospaced ligatures
  • Hermit () - A font for programmers, by a programmer
  • Inconsolata (ttf-inconsolata, included in ttf-google-fonts-gitAUR) – Designed for source code listing, inspired by Consolas and Letter Gothic
  • Inconsolata-g () – Adds some programmer-friendly modifications
  • Iosevka () ⟶ – 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
  • JetBrains Mono () ⟶ – Free and open-source font developed by JetBrains
  • Lucida Typewriter (included in package )
  • Menlo () – Customized version of Apple's Menlo Regular font for OS X with larger vertical gap spacing
  • Monaco (ttf-monacoAUR) – Proprietary font designed by Apple for OS X
  • Monofur ()
  • Mononoki () – A font for programming and code review
  • Source Code Pro (, included in ttf-google-fonts-gitAUR)
  • Comic Mono (ttf-comic-mono-gitAUR) A legible monospace font… the very typeface you’ve been trained to recognize since childhood, ergo Comic Sans

Relevant websites:

Sans-serif

Serif

Unsorted

  • – Font collection from dustismo.com
  • – Junius font containing almost complete medieval latin script glyphs
  • – Covers full plane 1 and several scripts
  • – IBM Courier and Adobe Utopia sets of PostScript fonts
  • – 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.

Ancient Scripts

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

Arabic

See Localization/Arabic#Fonts.

Bengali

Read Localization/Bengali#Fonts for details.

Braille

  • – Font containing Unicode symbols for braille
Pan-CJK

Adobe Source Han fonts and Noto CJK fonts have identical glyphs and metrics, but with different branding since the project was commissioned by both Adobe and Google.

Both collections comprehensively support Simplified Chinese, Traditional Chinese, Japanese, and Korean, with a consistent design and look.

Chinese

See Localization/Chinese#Fonts.

Japanese

See Localization/Japanese#Fonts.

Korean

See Localization/Korean#Fonts.

Vietnamese
  • – Vietnamese TrueType font for chữ Nôm characters

Cyrillic

See also #Latin script.

  • – Font family by ParaType: sans, serif, mono, extended cyrillic and latin, OFL license
  • – 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:

  • – Selection of OpenType fonts from the Greek Font Society
  • – Professional TrueType fonts from Magenta
  • – SBL Greek, created by the Society of Biblical Literature (SBL)
  • ttf-sbl-biblitAUR – SBL BibLit, includes characters from both SBL Greek and SBL Hebrew

Hebrew

  • – Large collection of Open-source licensed Hebrew fonts. There are also few Latin, Greek, Cyrillic, Arabic, and Amharic.
  • – Nice collection of free Hebrew fonts.
  • alefbetAUR – 2 Hebrew fonts (at the moment): the commonly used "David Libre", and the handwriting font "Gveret Levin".
  • – contains Arial and other fonts.
  • – SBL Hebrew, created by the Society of Biblical Literature (SBL)
  • ttf-sbl-biblitAUR – SBL BibLit, includes characters from both SBL Hebrew and SBL Greek

Indic

See Localization/Indic#Fonts.

Khmer

Mongolic and Tungusic

  • – Fonts for Sibe, Manchu and Daur scripts (incomplete, currently in development)

Persian

  • – Meta package for installing all Persian fonts in AUR.
  • – Borna Rayaneh Co. Persian B font series.
  • – A free Unicode calligraphic Persian font.
  • iranian-fontsAUR – Iranian-Sans and Iranian-Serif Persian font family.
  • – Iran Supreme Council of Information and Communication Technology (SCICT) standard Persian fonts.
  • – A Persian font series derived from X Series 2, Metafont and FarsiTeX fonts with Kashida feature.
  • – A Persian font series derived from X Series 2 fonts with Kashida feature.
  • , parastoo-fontsAUR, , , , , vazirmatn-fontsAUR, – Beautiful Persian fonts made by Saber RastiKerdar.
  • – The Yas Persian font series (with hollow zero).
  • – Free fonts with support for Persian, Arabic, Urdu, Pashto, Dari, Uzbek, Kurdish, Uighur, old Turkish (Ottoman) and modern Turkish (Roman).

Tai–Kadai

  • – Collection of scalable Thai fonts
  • – High-quality Thai fonts from Google and new improvement for Thai National Fonts
  • ttf-laoAUR – Lao TTF font (Phetsarath_OT)

Tibeto-Burman

  • – Tibetan Machine TTFont
  • – Unicode font that supports the many diverse languages that use the Myanmar script

Emoji and symbols

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

Emoji fonts come in different formats: CBDT/CBLC (Google), SBIX (Apple), COLR/CPAL (Microsoft), SVG (Mozilla/Adobe).

Emojis should work without any configuration once you have at least one emoji font installed of supported format. Emoji font fallback according to the standard requires extra code to handle emoji.

For the discovery and input of Emoji see List of applications/Utilities#Text input.

SoftwareCBDT/CBLCSBIXCOLR/CPALSVGEmoji font fallback
Freetype
Pango Freetype
WebKitGTK Freetype
Qt Freetype
Chromium Freetype
Firefox Freetype, see Firefox#Font troubleshooting for workaround.

CBDT/CBLC:

  • – Google's open-source Emoji 14.0.
  • ttf-joypixels – EmojiOne creator's proprietary Emoji 13.1.
  • – Twitter's open-source Emoji 13.0.

SVG:

  • – German University of Design in Schwäbisch Gmünd open-source Emoji 13.0.
  • ttf-twemoji-colorAUR – Twitter's open-source Emoji 13.0.

Outline only:

  • – provides many Unicode symbols, including emoji.

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: , , and .

Math

  • Computer Modern (, )
  • Computer Modern (, ) – Improved version used in LaTeX
  • STIX fonts (otf-stixAUR) – STIX is designed to be a royalty-free alternative that resembles Times New Roman. The current version is called STIX Two and includes a math companion named STIX Two Math.
  • TeX Gyre math fonts () – Math companions of TeX Gyre fonts (see #Families). Notably, TeX Gyre Termes Math is a math companion of Times New Roman.
  • XITS fonts () – A fork of STIX and therefore resembles Times New Roman. XITS includes a math companion called XITS Math, which has similar levels of completeness for mathematical symbols and alphabets when compared to STIX Two Math , although there are some visual differences.

Additionally, and contain many math fonts such as Latin Modern Math and STIX fonts. See TeX Live#Making fonts available to Fontconfig for configuration.

Other operating system fonts

Fallback font order

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 . 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>

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#Set default or fallback 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: for a font of the serif type (e.g. DejaVu Serif); for a font of the sans-serif type (e.g. DejaVu Sans); and 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, 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 . For instance, to list installed Arabic fonts or fonts supporting Arabic glyph:

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

For terminal emulators that use X resources, e.g. xterm or rxvt-unicode, fonts can be set by using escape sequences. Specifically, to change the normal font ( in ), and replace 710 with , , and 713 to change the , , and , respectively.

uses the same syntax as in  and can be anything the terminal emulator will support. (Example: )

Application-specific font cache

Matplotlib () uses its own font cache, so after updating fonts, be sure to remove , ~/.cache/matplotlib/fontList.cache, , etc. so it will regenerate its cache and find the new fonts .

Bidirectional text support

See Bidirectional text for troubleshooting problems related to RTL languages.

gollark: Also, earning krist at wolfmall can only be done via the sell shop hydro runs (which has kind of bad prices) or by running your own shop (high initial cost).
gollark: What does "BIDO" stand for Anyway?
gollark: It's only against the rules if you install it without explaining what it is and them agreeing.
gollark: ShutdownOS isn't even conveniently self-propagating.
gollark: What?

See also

This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.