Difference between revisions of "Fonts"

From ArchWiki
Jump to: navigation, search
(Korean: +Nanum series)
(update Pkg/AUR templates)
(Tag: wiki-scripts)
 
(329 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
 
[[Category:Fonts]]
 
[[Category:Fonts]]
[[Category:Graphics and desktop publishing]]
 
 
[[cs:Fonts]]
 
[[cs:Fonts]]
 +
[[de:Schriftarten]]
 
[[es:Fonts]]
 
[[es:Fonts]]
 
[[it:Fonts]]
 
[[it:Fonts]]
 +
[[ja:フォント]]
 
[[ru:Fonts]]
 
[[ru:Fonts]]
 
[[tr:Yazıtipleri]]
 
[[tr:Yazıtipleri]]
 
[[zh-CN:Fonts]]
 
[[zh-CN:Fonts]]
 
[[zh-TW:Fonts]]
 
[[zh-TW:Fonts]]
{{expansion}}
+
{{Related articles start}}
 +
{{Related|Font configuration}}
 +
{{Related|Infinality}}
 +
{{Related|Java Runtime Environment Fonts}}
 +
{{Related|Metric-compatible fonts}}
 +
{{Related articles end}}
  
{{Article summary start}}
+
From [[Wikipedia:Computer font|Wikipedia]]: "A computer font (or font) is an electronic data file containing a set of glyphs, characters, or symbols such as dingbats."
{{Article summary text|Covers the selection and installation of fonts on Arch Linux}}
+
 
{{Article summary heading|Legal}}
+
Note that certain font licenses may impose some legal limitations.
{{Article summary text|Certain font licenses may impose some legal limitations}}
+
{{Article summary heading|Related}}
+
{{Article summary wiki|Font Configuration}}: Font setup and beautification
+
{{Article summary wiki|Java Runtime Environment Fonts}}: Fonts specific to Sun's Java machine
+
{{Article summary wiki|MS Fonts}}: Adding Microsoft fonts and mimicking Windows' font settings
+
{{Article summary end}}
+
  
 
== Font formats ==
 
== Font formats ==
  
Most computer fonts used today are in either ''bitmap'' or ''outline'' data formats. Bitmap fonts store fixed images for each glyph in each typeface and point size. Outline or ''vector'' fonts store characters as instructions for drawing each glyph's lines and curves. Outline fonts scale smoothly in size over a wide range.
+
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.
  
Common font filename extensions include:
+
=== Common extensions ===
  
 
* {{ic|bdf}} and {{ic|bdf.gz}} – bitmap fonts, ''b''itmap ''d''istribution ''f''ormat and gzip compressed {{ic|bdf}}
 
* {{ic|bdf}} and {{ic|bdf.gz}} – bitmap fonts, ''b''itmap ''d''istribution ''f''ormat and gzip compressed {{ic|bdf}}
 
* {{ic|pcf}} and {{ic|pcf.gz}} – bitmaps, ''p''ortable ''c''ompiled ''f''ont and gzip compressed {{ic|pcf}}
 
* {{ic|pcf}} and {{ic|pcf.gz}} – bitmaps, ''p''ortable ''c''ompiled ''f''ont and gzip compressed {{ic|pcf}}
* {{ic|psf}}, {{ic|psfu}}, {{ic|psf.gz}} and {{ic|psfu.gz}} – bitmaps, ''P''C ''s''creen ''f''ont, ''P''C ''s''creen ''f''ont ''U''nicode and the gzipped versions (not compatible with Xorg)
+
* {{ic|psf}}, {{ic|psfu}}, {{ic|psf.gz}} and {{ic|psfu.gz}} – bitmaps, ''P''C ''s''creen ''f''ont, ''P''C ''s''creen ''f''ont ''U''nicode and the gzipped versions (not compatible with X.Org)
 
* {{ic|pfa}} and {{ic|pfb}} – outline fonts, ''P''ostScript ''f''ont ''A''SCII and ''P''ostScript ''f''ont ''b''inary. PostScript fonts carry built-in printer instructions.
 
* {{ic|pfa}} and {{ic|pfb}} – outline fonts, ''P''ostScript ''f''ont ''A''SCII and ''P''ostScript ''f''ont ''b''inary. PostScript fonts carry built-in printer instructions.
 
* {{ic|ttf}} – outline, ''T''rue''T''ype ''f''ont. Originally designed as a replacement for the PostScript fonts.
 
* {{ic|ttf}} – outline, ''T''rue''T''ype ''f''ont. Originally designed as a replacement for the PostScript fonts.
Line 45: Line 47:
 
== Installation ==
 
== Installation ==
  
Various methods of installing fonts.
+
There are various methods for installing fonts.
  
 
=== Pacman ===
 
=== Pacman ===
  
Fonts and font collections in the enabled repositories can be installed using [[Pacman|pacman]]. Available fonts may be found by using:
+
Fonts and font collections in the enabled repositories can be installed using [[pacman]]. Available fonts may be found by using:
 
  $ pacman -Ss font
 
  $ pacman -Ss font
 +
 
Or to search for {{ic|ttf}} fonts only:
 
Or to search for {{ic|ttf}} fonts only:
 
  $ pacman -Ss ttf
 
  $ pacman -Ss ttf
 
Some fonts like <i>terminus</i> are installed in {{ic|/usr/share/fonts/local}}, which is not added to the font path by default. By adding the following lines to {{ic|~/.xinitrc}}
 
{{bc|
 
xset +fp /usr/share/fonts/local
 
xset fp rehash
 
}}
 
the fonts can be used in X11.
 
  
 
=== Creating a package ===
 
=== Creating a package ===
  
If you want to give pacman the ability to manage your fonts, you can create an Arch package. These can also be shared with the community in the [[AUR]]. Here is an example of how to create a basic package. To learn more about building packages, read [[PKGBUILD]].
+
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]]. Here is an example of how to create a basic package. To learn more about building packages, read [[PKGBUILD]].
  
{{bc|<nowiki>
+
The family name of a font file can be aquired with the use of {{ic|fc-query}} for example: {{ic|fc-query -f '%{family[0]}\n' /path/to/file}}.  The formatting is described in the FcPatternFormat(3) manual.
pkgname=ttf-fontname
+
 
 +
{{hc|PKGBUILD|<nowiki>
 +
pkgname=fontname-fonts
 
pkgver=1.0
 
pkgver=1.0
 
pkgrel=1
 
pkgrel=1
depends=('fontconfig' 'xorg-font-utils')
+
pkgdesc="Some description"
pkgdesc="custom fonts"
+
arch=(any)
arch=('any')
+
depends=(fontconfig xorg-font-utils)
source=(http://someurl.org/$pkgname.tar.bz2)
+
source=("http://someurl.org/$pkgname.tar.bz2")
 
install=$pkgname.install
 
install=$pkgname.install
  
build()
+
package() {
{
+
   install -Dm644 $pkgname/font.otf "$pkgdir"/usr/share/fonts/family_name/font.otf
   mkdir -p $pkgdir/usr/share/fonts/TTF
+
   install -Dm644 $pkgname/font_bold.otf "$pkgdir"/usr/share/fonts/family_name/font_bold.otf
   cp $srcdir/$pkgname/*.ttf $pkgdir/usr/share/fonts/TTF
+
 
}
 
}
 
</nowiki>}}
 
</nowiki>}}
  
This PKGBUILD assumes the fonts are TrueType.  An install file ({{ic|ttf-fontname.install}}) will also need to be created to update the font cache:
+
{{hc|fontname-fonts.install|<nowiki>
 
+
{{bc|<nowiki>
+
 
post_install() {
 
post_install() {
  echo -n "Updating font cache... "
+
   fc-cache -s
   fc-cache -fs >/dev/null
+
  mkfontscale /usr/share/fonts/TTF /usr/share/fonts/Type1
+
  mkfontdir /usr/share/fonts/TTF /usr/share/fonts/Type1
+
  echo "done"
+
 
}
 
}
  
 
post_upgrade() {
 
post_upgrade() {
 +
  post_install
 +
}
 +
 +
post_remove() {
 
   post_install
 
   post_install
 
}
 
}
Line 100: Line 95:
 
=== Manual installation ===
 
=== Manual installation ===
  
The recommended way of adding fonts to your system that are not in the repositories is described in [[#Creating a package]]. This gives pacman the ability to be able to remove or update them at a later time. Fonts can alternately be installed manually as well.
+
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 {{ic|/usr/share/fonts/}} directory. To install fonts for only a single user, use {{ic|~/.fonts/}} instead.
+
To install fonts system-wide (available for all users), move the folder to the {{ic|/usr/share/fonts/}} directory. The files need to be readable by every user, use [[chmod]] to set the correct permissions (i.e. at least {{ic|0444}} for files and {{ic|0555}} for directories). To install fonts for only a single user, use {{ic|~/.local/share/fonts}} ({{ic|~/.fonts/}} is now deprecated).
  
Also you may need to update {{ic|/etc/X11/xorg.conf}} or {{ic|/etc/xorg.conf}} with the new directory. Search for {{ic|FontPath}} to find the correct location within the file to add your new path. See [[#Fonts with Xorg]] for more detail.
+
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 [[Xorg#Configuration|of your Xorg configuration file]] (e.g. {{ic|/etc/X11/xorg.conf}} or {{ic|/etc/xorg.conf}}). See [[#Older applications]] for more detail.
  
Then update the fontconfig font cache:
+
Then update the fontconfig font cache: (usually unnecessary as software using the fontconfig library do this.)
  
  $ fc-cache -vf
+
  $ fc-cache
  
==== Older applications ====
+
=== Older applications ===
  
With older applications that do not support fontconfig (e.g. GTK1 applications, and {{ic|xfontsel}}) the index will need to be created in the font directory:
+
With older applications that do not support fontconfig (e.g. GTK+ 1.x applications, and {{ic|xfontsel}}) the index will need to be created in the font directory:
  
 
  $ mkfontscale
 
  $ mkfontscale
Line 120: Line 115:
  
 
  $ for dir in /font/dir1/ /font/dir2/; do xset +fp $dir; done && xset fp rehash
 
  $ 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. {{ic|/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 {{ic|fonts.dir}} files:
 
At times the X server may fail to load the fonts directory and you will need to rescan all the {{ic|fonts.dir}} files:
Line 129: Line 128:
  
 
  $ xlsfonts | grep fontname
 
  $ 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 {{ic|/etc/X11/xorg.conf}} or {{ic|/etc/X11/xorg.conf.d}}.
 +
 +
Here is an example of the section that must be added to {{ic|/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 ===
 
=== Pango Warnings ===
When [http://www.pango.org/ Pango] is in use on your system it will read from [http://fontconfig.org/wiki/ fontconfig] to sort out where to source fonts.
+
 
 +
When [http://www.pango.org/ Pango] is in use on your system it will read from [http://www.freedesktop.org/wiki/Software/fontconfig 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='common'
 
  (process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='latin'
 
  (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 {{Pkg|ttf-liberation}} fonts to illustrate the solution and runs as root to enable them system-wide.
+
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 {{Pkg|ttf-liberation}} fonts to illustrate the solution (after successful installation of the package) and runs as root to enable them system-wide.
 
+
# pacman -S ttf-liberation
+
  -- output abbreviated, assumes installation succeeded --
+
 
   
 
   
  # fc-cache -vfs
+
  # fc-cache
 
  /usr/share/fonts: caching, new cache contents: 0 fonts, 3 dirs
 
  /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/TTF: caching, new cache contents: 16 fonts, 0 dirs
Line 147: Line 163:
 
  /usr/share/fonts/encodings/large: caching, new cache contents: 0 fonts, 0 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
 
  /usr/share/fonts/util: caching, new cache contents: 0 fonts, 0 dirs
  /var/cache/fontconfig: cleaning cache directory  
+
  /var/cache/fontconfig: cleaning cache directory
 
  fc-cache: succeeded
 
  fc-cache: succeeded
  
Line 155: Line 171:
 
  LiberationMono-Regular.ttf: "Liberation Mono" "Regular"
 
  LiberationMono-Regular.ttf: "Liberation Mono" "Regular"
  
=== Fonts with Xorg ===
+
== Console fonts ==
  
In order for [[Xorg]] to find and use your newly installed fonts, you must add the font paths to {{ic|/etc/X11/xorg.conf}} (another Xorg configuration file may work too).
+
{{Note|This section is about the [[Wikipedia:Linux console|Linux console]]. For alternative console solutions offering more features (full Unicode fonts, modern graphics adapters etc.), see [[fbterm]], [[KMSCON]] or similar projects.}}
  
Here is an example of the section that must be added to {{ic|/etc/X11/xorg.conf}}. Add or remove paths based on your particular font requirements.
+
By default, the [[Wikipedia:Virtual console|virtual console]] uses the kernel built-in font with a [[Wikipedia:CP437|CP437]] character set,<sup>[https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/vt/Makefile#n4]</sup> but this can be easily changed.
# Let Xorg 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/local"
+
    FontPath    "/usr/share/fonts/misc"
+
    FontPath    "/usr/share/fonts/truetype"
+
    FontPath    "/usr/share/fonts/TTF"
+
    FontPath    "/usr/share/fonts/util"
+
EndSection
+
  
==Font packages==
+
The [[Wikipedia:Linux console|Linux console]] uses UTF-8 encoding by default, but because the standard VGA-compatible framebuffer is used, a console font is limited to either a standard 256, or 512 glyphs. If the font has more than 256 glyphs, the number of colours is reduced from 16 to 8. In order to assign correct symbol to be displayed to the given Unicode value, a special translation map, often called ''unimap'', is needed. Nowadays most of the console fonts have the ''unimap'' built-in, historically it had to be loaded separately.
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.
+
  
===Braille===
+
The {{Pkg|kbd}} package provides tools to change virtual console font and font mapping. Available fonts are saved in the {{ic|/usr/share/kbd/consolefonts/}} directory, those ending with ''.psfu'' or ''.psfu.gz'' have a Unicode translation map built-in.
*{{Pkg|ttf-ubraille}} - Font containing Unicode symbols for ''braille''
+
  
===International users===
+
Keymaps, the connection between the key pressed and the character used by the computer, are found in the subdirectories of {{ic|/usr/share/kbd/keymaps/}}, see [[Keyboard configuration in console]] for details.
  
====Arabic====
+
{{Note|Replacing the font can cause issues with programs that expect a standard VGA-style font, such as those using line drawing graphics.}}
*{{AUR|ttf-sil-lateef}} - Unicode Arabic font from SIL ''(AUR)''
+
*{{AUR|ttf-sil-scheherazade}} - Unicode Arabic font from SIL ''(AUR)''
+
*{{AUR|ttf-arabeyes-fonts}} - Collection of free Arabic fonts ''(AUR)''
+
  
====Birman====
+
{{Tip|For European based languages written in Latin/Greek letters you can use {{ic|eurlatgr}} font, it includes a broad range of Latin/Greek letter variations as well as
*{{AUR|ttf-myanmar3}} - Font for Myanmar/Burmese script ''(AUR)''
+
special characters [https://lists.altlinux.org/pipermail/kbd/2014-February/000439.html].}}
  
====Chinese, Japanese, Korean, Vietnamese====
+
=== Preview and temporary changes ===
  
=====(Mainly) Chinese=====
+
{{Tip|An organized library of images for previewing is available: [http://alexandre.deverteuil.net/pages/consolefonts/ Linux console fonts screenshots].}}
*{{AUR|ttf-tw}} - Kai and Song traditional Chinese font from the Ministry of Education of Taiwan ''(AUR)''.
+
*{{AUR|wqy-microhei}} - A Sans-Serif style high quality CJK outline font. ''(AUR)''
+
*{{Pkg|wqy-zenhei}} - Hei Ti Style (sans-serif) Chinese Outline font embedded with bitmapped Song Ti (also supporting Japanese (partial) and Korean characters).
+
*{{Pkg|ttf-arphic-ukai}} - ''Kaiti'' (brush stroke) Unicode font (enabling anti-aliasing is suggested)
+
*{{Pkg|ttf-arphic-uming}} - ''Mingti'' (printed) Unicode font
+
*{{Pkg|opendesktop-fonts}} - ''New Sung'' font, previously is ttf-fireflysung package
+
*{{Pkg|wqy-bitmapfont}} - Bitmapped Song Ti (serif) Chinese font
+
*{{Pkg|ttf-hannom}} - Chinese and Vietnamese TrueType font
+
  
=====Japanese=====
+
$ showconsolefont
*{{AUR|otf-ipafont}} - Formal style Japanese Gothic (san-serif) and Mincho (serif) fonts set; one of the highest quality open source font. Default of openSUSE-ja. ''(AUR)''
+
*{{AUR|ttf-vlgothic}} - Japanese Gothic fonts. Default of Debian/Fedora/Vine Linux ''(AUR)''
+
*{{AUR|ttf-mplus}} - 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).
+
*{{AUR|ttf-ipa-mona}}, {{AUR|ttf-monapo}} - Japanese fonts to show [http://en.wikipedia.org/wiki/2channel_Shift_JIS_art 2channel Shift JIS art] properly. ''(AUR)''
+
*{{Pkg|ttf-sazanami}} - Japanese free TrueType font. This is outdated and not maintained any more, but may be defined as a fallback font on several environment.
+
  
=====Korean=====
+
shows a table of glyphs or letters of a font.
*{{Pkg|ttf-baekmuk}} - Collection of Korean TrueType fonts
+
*{{AUR|ttf-alee}} - Set of free Hangul TrueType fonts (''AUR'')
+
*{{AUR|ttf-unfonts-core}} - Un fonts (default Baekmuk fonts may be unsatisfactory) (''AUR'')
+
*{{AUR|ttf-nanum}} - Nanum series TrueType fonts (''AUR'')
+
*{{AUR|ttf-nanumgothic_coding}} - Nanum series fixed width TrueType fonts (''AUR'')
+
  
====Cyrillic====
+
{{ic|setfont}} temporarily change the font if passed a font name (in {{ic|/usr/share/kbd/consolefonts/}}) such as
''Also see [[#Monospace]], [[#Sans]] and [[#Serif]]''
+
*{{AUR|font-arhangai}} - Mongolian Cyrillic (''AUR'')
+
*{{AUR|ttf-pingwi-typography}} - PingWi Typography (PWT) fonts (''AUR'')
+
  
====Greek====
+
$ setfont lat2-16 -m 8859-2
Almost all Unicode fonts contain the Greek character set (polytonic included). Some additional font packages, which might not be contain the complete Unicode set but utilize high quality Greek (and Latin, of course) typefaces are:
+
*{{AUR|otf-gfs}} - Selection of OpenType fonts from the Greek Font Society ''(AUR)''
+
*{{AUR|ttf-mgopen}} - Professional TrueType fonts from Magenta ''(AUR)''
+
  
====Hebrew====
+
Font names are case-sensitive. With no parameter, {{ic|setfont}} returns the console to the default font.
*{{AUR|culmus}} - Nice collection of free Hebrew fonts
+
  
====Indic====
+
{{Tip|All font changing commands can be typed in "blind".}}
*{{Pkg|ttf-freebanglafont}} - Font for Bangla
+
*{{Pkg|ttf-indic-otf}} - Indic OpenType Fonts collection (containing ttf-freebanglafont)
+
:(This one contains a ಠ_ಠ "look of disapproval" that might be more to your liking than the {{Pkg|bdf-unifont}} one mentioned elsewhere in this document)
+
* {{Pkg|lohit-font}} - Indic TrueType fonts from Fedora Project (containing Oriya Fonts and more) ''(AUR)''
+
  
====Khmer====
+
{{Note|''setfont'' only works on the console currently being used. Any other consoles, active or inactive, remain unaffected.}}
*{{Pkg|ttf-khmer}} - Font covering glyphs for Khmer language
+
*[http://code.google.com/webfonts/family?family=Hanuman&subset=khmer Hanuman] ({{AUR|ttf-google-webfonts}})
+
  
====Sinhala====
+
=== Persistent configuration ===
*{{AUR|ttf-lklug}} - Sinhala Unicode font (''AUR'')
+
  
====Tamil====
+
The {{ic|FONT}} variable in {{ic|/etc/vconsole.conf}} is used to set the font at boot, persistently for all consoles. See {{ic|man 5 vconsole.conf}} for details.
*{{AUR|ttf-tamil}} - Tamil Unicode fonts (''AUR'')
+
  
====Thai====
+
For displaying characters such as ''Č, ž, đ, š'' or ''Ł, ę, ą, ś'' using the font {{ic|lat2-16.psfu.gz}}:
*{{Pkg|ttf-thai}} - Font covering glyphs for Thai
+
 
====Tibetan====
+
{{hc|/etc/vconsole.conf|2=
*{{Pkg|ttf-tibetan-machine}} - Tibetan Machine TTFont
+
...
 +
FONT=lat2-16
 +
FONT_MAP=8859-2
 +
}}
 +
 
 +
It means that second part of ISO/IEC 8859 characters are used with size 16. You can change font size using other values (e.g. {{ic|lat2-08}}). For the regions determined by 8859 specification, look at the [[wikipedia:ISO/IEC_8859#The_Parts_of_ISO.2FIEC_8859|Wikipedia table]].
 +
 
 +
To use the specified font in early userspace, use the {{ic|consolefont}} hook in {{ic|/etc/mkinitcpio.conf}}. See [[Mkinitcpio#HOOKS]] for more information.
 +
 
 +
If the fonts seems to not change on boot, or change only temporarily, it is most likely that they got reset when graphics driver was initialized and console was switched to framebuffer. To avoid this, load your graphics driver earlier. See for example [[Kernel mode setting#Early KMS start]], [https://bbs.archlinux.org/viewtopic.php?id=145765] or other ways to setup your framebuffer before {{ic|/etc/vconsole.conf}} is applied.
 +
 
 +
== 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.
 +
 
 +
Github user Ternstor has created a python script that generates HTML documents with PNG images of all the fonts in the AUR and the official repositories: [https://github.com/ternstor/distrofonts/blob/master/archfonts.py].
  
===Math===
+
=== Latin script ===
*{{Pkg|font-mathematica}} - Mathematica fonts by Wolfram Research, Inc.
+
*{{AUR|ttf-mathtype}} - MathType fonts ''(AUR)''
+
*{{AUR|ttf-computer-modern-fonts}} - ''(AUR)''
+
  
===Microsoft fonts===
+
==== Monospaced ====
See [[MS Fonts]].
+
  
===Monospaced===
 
 
Here are some suggestions. Every user has their own favorite, so experiment to find yours.  
 
Here are some suggestions. Every user has their own favorite, so experiment to find yours.  
If you're in a hurry, you read Dan Benjamin's blog post: [http://hivelogic.com/articles/top-10-programming-fonts ''Top 10 Programming Fonts''].
+
If you are in a hurry, you read Dan Benjamin's blog post: [http://hivelogic.com/articles/top-10-programming-fonts ''Top 10 Programming Fonts''].
  
Here's a long list of fonts by Trevor Lowing: http://www.lowing.org/fonts/
+
Here is a long list of fonts by Trevor Lowing: http://www.lowing.org/fonts/.
  
====TrueType====
+
A comparison with images on Slant: [http://www.slant.co/topics/67/~what-are-the-best-programming-fonts What are the best programming fonts?]
*[[Wikipedia:Andalé Mono|Andalé Mono]] ({{AUR|ttf-ms-fonts}})
+
*Anka/Coder ({{AUR|ttf-anka-coder}})
+
*Anonymous Pro ({{AUR|ttf-anonymous-pro}}, included in {{AUR|ttf-google-webfonts}})
+
*[[Wikipedia:Bitstream Vera|Bitstream Vera Mono]] ({{Pkg|ttf-bitstream-vera}})
+
*[[Wikipedia:Consolas|Consolas]] ({{AUR|ttf-vista-fonts}})
+
*[[Wikipedia:Courier New|Courier New]] ({{AUR|ttf-ms-fonts}})
+
*Cousine ({{AUR|ttf-google-webfonts}}) - Chrome/Chromium OS replacement for Courier New (metric-compatible)
+
*[[Wikipedia:DejaVu fonts|DejaVu Sans Mono]] ({{Pkg|ttf-dejavu}}) - Unicode
+
*[[Wikipedia:Droid (font)|Droid Sans Mono]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-webfonts}})
+
*Envy Code R ({{AUR|ttf-envy-code-r}})
+
*[[Wikipedia:GNU FreeFont|FreeMono]] ({{Pkg|ttf-freefont}}) - Unicode
+
*[[Wikipedia:Inconsolata|Inconsolata]] ({{Pkg|ttf-inconsolata}})
+
*[[Wikipedia:Inconsolata|Inconsolata-g]] ({{AUR|ttf-inconsolata-g}}) - adds some programmer-friendly modifications
+
*[[Wikipedia:Liberation fonts|Liberation Mono]] ({{Pkg|ttf-liberation}}) - Alternative to Courier New (metric-compatible)
+
*[[Wikipedia:Lucida Console|Lucida Console]] ({{AUR|ttf-ms-fonts}})
+
*[[Wikipedia:Lucida Typewriter|Lucida Typewriter]] (included in package {{Pkg|jre}})
+
*[[Wikipedia:Monaco (typeface)|Monaco]] ({{Pkg|monaco-linux-font}})
+
*Monofur ({{AUR|ttf-monofur}})
+
  
====Bitmap====
+
And a Stack Overflow question with some images: [http://stackoverflow.com/questions/4689/recommended-fonts-for-programming Recommended fonts for programming]
*Default 8x16
+
*Dina ({{Pkg|dina-font}})
+
*Lime ({{Pkg|artwiz-fonts}})
+
*[[Wikipedia:ProFont|ProFont]] ({{Pkg|profont}})
+
*[[Wikipedia:Proggy Programming Fonts|Proggy Programming Fonts]] ({{AUR|proggyfonts}})
+
*Proggy opti cyrillic ({{AUR|proggyopticyr-font}})
+
*Tamsyn ({{AUR|tamsyn-font}})
+
*[[Wikipedia:Terminus (typeface)|Terminus]] ({{Pkg|terminus-font}})
+
*Unifont (glyphs like ಠ_ಠ (look of disapproval)) ({{Pkg|bdf-unifont}})
+
  
===Sans-serif===
+
===== TrueType =====
  
*[http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=andika Andika] ({{AUR|ttf-andika}}, included in {{AUR|ttf-sil-fonts}})
+
* [[Wikipedia:Andalé Mono|Andalé Mono]] ({{AUR|ttf-ms-fonts}})
*[[Wikipedia:Arial|Arial]] ({{AUR|ttf-ms-fonts}})
+
* [http://www.marksimonson.com/fonts/view/anonymous-pro Anonymous Pro] ({{pkg|ttf-anonymous-pro}}, included in {{AUR|ttf-google-fonts-git}})
*[[Wikipedia:Arial Black|Arial Black]] ({{AUR|ttf-ms-fonts}})
+
* [[Wikipedia:Bitstream Vera|Bitstream Vera Mono]] ({{Pkg|ttf-bitstream-vera}})
*Arimo ({{AUR|ttf-google-webfonts}}) - Chrome/Chromium OS replacement for Arial (metric-compatible)
+
* [[Wikipedia:Consolas|Consolas]] ({{AUR|ttf-vista-fonts}}) - Windows programming font
*[[Wikipedia:Calibri|Calibri]] ({{AUR|ttf-vista-fonts}})
+
* [[Wikipedia:Courier New|Courier New]] ({{AUR|ttf-ms-fonts}})
*[[Wikipedia:Candara|Candara]] ({{AUR|ttf-vista-fonts}})
+
* Cousine ({{AUR|ttf-chromeos-fonts}} or {{AUR|ttf-google-fonts-git}}) - Chrome/Chromium OS replacement for Courier New (metric-compatible)
*[[Wikipedia:Constantia (typeface)|Constantia]] ({{AUR|ttf-vista-fonts}})
+
* [[Wikipedia:DejaVu fonts|DejaVu Sans Mono]] ({{Pkg|ttf-dejavu}}) - Unicode
*[[Wikipedia:Corbel (typeface)|Corbel]] ({{AUR|ttf-vista-fonts}})
+
* [[Wikipedia:Droid (font)|Droid Sans Mono]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-fonts-git}})
*[[Wikipedia:DejaVu fonts|DejaVu Sans]] ({{Pkg|ttf-dejavu}}) - Unicode
+
* [https://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released Envy Code R] ({{AUR|ttf-envy-code-r}})
*[[Wikipedia:Droid (font)|Droid Sans]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-webfonts}})
+
* Fantasque Sans Mono ({{AUR|ttf-fantasque-sans}} or {{AUR|ttf-fantasque-sans-git}})
*[[Wikipedia:GNU FreeFont|FreeSans]] ({{Pkg|ttf-freefont}}) - Unicode
+
* [[Wikipedia:Fira_Sans|Fira Mono]] ({{pkg|ttf-fira-mono}})
*[[Wikipedia:Impact (typeface)|Impact]] ({{AUR|ttf-ms-fonts}})
+
* [[Wikipedia:GNU FreeFont|FreeMono]] ({{Pkg|ttf-freefont}}) - Unicode
*[[Wikipedia:Liberation fonts|Liberation Sans]] ({{Pkg|ttf-liberation}}, improved/reworked Cyrillic: {{Pkg|ttf-liberastika}}) - Alternative to Arial  (metric-compatible)
+
* [https://sourcefoundry.org/hack/ Hack]] ({{pkg|ttf-hack}})
*[[Wikipedia:Liberation fonts|Liberation Sans Narrow]] ({{Pkg|ttf-liberation}}) - Alternative to Arial Narrow (metric-compatible)
+
* [[Wikipedia:Inconsolata|Inconsolata]] ({{Pkg|ttf-inconsolata}}, included in {{AUR|ttf-google-fonts-git}}) - Excellent programming font
*[[Wikipedia:Linux Libertine|Linux Biolinum]] ({{Pkg|ttf-linux-libertine}})
+
* [[Wikipedia:Inconsolata|Inconsolata-g]] ({{AUR|ttf-inconsolata-g}}) - adds some programmer-friendly modifications
*[[Wikipedia:Lucida Sans|Lucida Sans]] ({{AUR|ttf-ms-fonts}})
+
* [[Wikipedia:Liberation fonts|Liberation Mono]] ({{Pkg|ttf-liberation}}) - Replacement for Courier New, based on Cousine (metric-compatible)
*[[Wikipedia:Microsoft Sans Serif|Microsoft Sans Serif]] ({{AUR|ttf-ms-fonts}})
+
* [[Wikipedia:Lucida Typewriter|Lucida Typewriter]] (included in package {{AUR|jre}})
*[[Wikipedia:PT Sans|PT Sans]] ({{AUR|ttf-google-webfonts}}) - 3 major variations: normal, narrow, and caption - Unicode: Latin, Cyrillic
+
* [[Wikipedia:Monaco (typeface)|Monaco]] ({{AUR|ttf-monaco}}) - Popular programming font on OSX/Textmate
*[[Wikipedia:Tahoma (typeface)|Tahoma]] ({{AUR|ttf-tahoma}})
+
* Monofur ({{AUR|ttf-monofur}})
*[[Wikipedia:Trebuchet MS|Trebuchet]] ({{AUR|ttf-ms-fonts}})
+
* [[Wikipedia:Source_Code_Pro|Source Code Pro]] ({{pkg|adobe-source-code-pro-fonts}})
*[[Wikipedia:Ubuntu-Title|Ubuntu-Title]] ({{AUR|ttf-ubuntu-title}})
+
*[[Wikipedia:Ubuntu Font Family|Ubuntu Font Family]] ({{Pkg|ttf-ubuntu-font-family}})
+
*[[Wikipedia:Verdana|Verdana]] ({{AUR|ttf-ms-fonts}})
+
  
===Script===
+
===== Bitmap =====
  
*[[Wikipedia:Comic Sans|Comic Sans]] ({{AUR|ttf-ms-fonts}})
+
* Default 8x16
 +
* Dina ({{Pkg|dina-font}})
 +
* [http://font.gohu.org/ Gohu] ({{AUR|gohufont}})
 +
* Lime ({{Pkg|artwiz-fonts}})
 +
* [[Wikipedia:ProFont|ProFont]] ({{Pkg|profont}})
 +
* [[Wikipedia:Proggy Programming Fonts|Proggy Programming Fonts]] ({{AUR|proggyfonts}})
 +
* Tamsyn ({{Pkg|tamsyn-font}})
 +
* [http://terminus-font.sourceforge.net/ Terminus] ({{Pkg|terminus-font}})
 +
* [https://github.com/lucy/tewi-font Tewi] ({{AUR|bdf-tewi-git}})
 +
* Unifont (glyphs like (look of disapproval)) ({{Pkg|bdf-unifont}})
  
===Serif===
+
==== Sans-serif ====
*[[Wikipedia:Cambria (typeface)|Cambria]] ({{AUR|ttf-vista-fonts}})
+
*[[Wikipedia:Charis SIL|Charis]] ({{AUR|ttf-charis}}, included in {{AUR|ttf-sil-fonts}}) - Unicode: Latin, Cyrillic
+
*[[Wikipedia:DejaVu fonts|DejaVu Serif]] ({{Pkg|ttf-dejavu}}) - Unicode
+
*[[Wikipedia:Doulos SIL|Doulos]] ({{AUR|doulos-sil}}, included in {{AUR|ttf-sil-fonts}}) - Unicode: Latin, Cyrillic
+
*[[Wikipedia:Droid (font)|Droid Serif]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-webfonts}})
+
*[[Wikipedia:GNU FreeFont|FreeSerif]] ({{Pkg|ttf-freefont}}) - Unicode
+
*[[Wikipedia:Gentium|Gentium]] ({{Pkg|ttf-gentium}}, included in {{AUR|ttf-sil-fonts}}) - Unicode: Latin, Greek, Cyrillic, Phonetic Alphabet
+
*[[Wikipedia:Georgia (typeface)|Georgia]] ({{AUR|ttf-ms-fonts}})
+
*[[Wikipedia:Liberation fonts|Liberation Serif]] ({{Pkg|ttf-liberation}}) - Alternative to Times New Roman (metric-compatible)
+
*[[Wikipedia:Linux Libertine|Linux Libertine]] ({{Pkg|ttf-linux-libertine}}) - Unicode: Latin, Greek, Cyrillic, Hebrew
+
*[[Wikipedia:Times New Roman|Times New Roman]] ({{AUR|ttf-ms-fonts}})
+
*Tinos ({{AUR|ttf-google-webfonts}}) - Chrome/Chromium OS replacement for Times New Roman (metric-compatible)
+
  
===Unsorted===
+
* [http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=andika Andika] ({{AUR|ttf-andika}})
<!--This section should be absorbed into the Monospace/Serif/Sans-Serif structure-->
+
* [[Wikipedia:Arial|Arial]] ({{AUR|ttf-ms-fonts}})
*{{AUR|ttf-google-webfonts}} - a huge collection of free fonts (including ubuntu, inconsolata, droid, etc.) - Note: Your font dialog might get very long as >100 fonts will be added
+
* [[Wikipedia:Arial Black|Arial Black]] ({{AUR|ttf-ms-fonts}})
*{{Pkg|ttf-mph-2b-damase}} - Covers full plane 1 and several scripts
+
* Arimo ({{AUR|ttf-chromeos-fonts}} or {{AUR|ttf-google-fonts-git}}) - Chrome/Chromium OS replacement for Arial (metric-compatible)
*{{AUR|ttf-symbola}} - Provides emoji and many many other symbols.
+
* [[Wikipedia:Calibri|Calibri]] ({{AUR|ttf-vista-fonts}})
*{{AUR|ttf-sil-fonts}} - Gentium, Charis, Doulos, Andika and Abyssinica from SIL ''(AUR)''
+
* [[Wikipedia:Candara|Candara]] ({{AUR|ttf-vista-fonts}})
*{{Pkg|font-bh-ttf}} - Xorg Luxi fonts
+
* [[Wikipedia:Comic Sans|Comic Sans]] ({{AUR|ttf-ms-fonts}})
*{{Pkg|ttf-cheapskate}} - Font collection from ''dustismo.com''
+
* [[Wikipedia:Corbel (typeface)|Corbel]] ({{AUR|ttf-vista-fonts}})
*{{Pkg|ttf-isabella}} - Calligraphic font based on the ''Isabella Breviary'' of 1497
+
* [[Wikipedia:DejaVu fonts|DejaVu Sans]] ({{Pkg|ttf-dejavu}}) - Unicode
*{{Pkg|ttf-junicode}} - Junius font containing almost complete medieval latin script glyphs
+
* [[Wikipedia:Droid (font)|Droid Sans]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-fonts-git}})
*arkpandorafonts {{AUR|ttf-arkpandora}} — Alternative to Arial and Times New Roman fonts
+
* [[Wikipedia:GNU FreeFont|FreeSans]] ({{Pkg|ttf-freefont}}) - Unicode
*{{Pkg|xorg-fonts-type1}} — IBM Courier and Adobe Utopia sets of [[Wikipedia:PostScript fonts|PostScript fonts]]
+
* [[Wikipedia:Impact (typeface)|Impact]] ({{AUR|ttf-ms-fonts}})
 +
* [[Wikipedia:Liberation fonts|Liberation Sans]] ({{Pkg|ttf-liberation}}) Replacement for Arial, based on Arimo (metric-compatible)
 +
* [[Wikipedia:Linux Libertine|Linux Biolinum]] ({{Pkg|ttf-linux-libertine}})
 +
* [[Wikipedia:Lucida Sans|Lucida Sans]] ({{AUR|ttf-ms-fonts}})
 +
* [[Wikipedia:Microsoft Sans Serif|Microsoft Sans Serif]] ({{AUR|ttf-ms-fonts}})
 +
* [[Wikipedia:PT Sans|PT Sans]] ({{AUR|ttf-google-fonts-git}}) - 3 major variations: normal, narrow, and caption - Unicode: Latin, Cyrillic
 +
* [[Wikipedia:Source Sans Pro|Source Sans Pro]] ({{pkg|adobe-source-sans-pro-fonts}})
 +
* [[Wikipedia:Tahoma (typeface)|Tahoma]] ({{AUR|ttf-tahoma}})
 +
* [[Wikipedia:Trebuchet MS|Trebuchet]] ({{AUR|ttf-ms-fonts}})
 +
* [[Wikipedia:Ubuntu Font Family|Ubuntu Font Family]] ({{Pkg|ttf-ubuntu-font-family}})
 +
* [[Wikipedia:Verdana|Verdana]] ({{AUR|ttf-ms-fonts}})
  
==Console fonts==
+
==== Serif ====
  
The console, meaning a terminal running with no ''X'' Window System, uses the ASCII character set as the default. This font and the keymap used are easily changed.
+
* [[Wikipedia:Cambria (typeface)|Cambria]] ({{AUR|ttf-vista-fonts}})
 +
* [[Wikipedia:Constantia (typeface)|Constantia]] ({{AUR|ttf-vista-fonts}})
 +
* [[Wikipedia:DejaVu fonts|DejaVu Serif]] ({{Pkg|ttf-dejavu}}) - Unicode
 +
* [[Wikipedia:Droid (font)|Droid Serif]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-fonts-git}})
 +
* [[Wikipedia:GNU FreeFont|FreeSerif]] ({{Pkg|ttf-freefont}}) - Unicode
 +
* [[Wikipedia:Gentium|Gentium]] ({{Pkg|ttf-gentium}}) - Unicode: Latin, Greek, Cyrillic, Phonetic Alphabet
 +
* [[Wikipedia:Georgia (typeface)|Georgia]] ({{AUR|ttf-ms-fonts}})
 +
* [[Wikipedia:Liberation fonts|Liberation Serif]] ({{Pkg|ttf-liberation}}) - Replacement for Times New Roman, based on Tinos (metric-compatible)
 +
* [[Wikipedia:Linux Libertine|Linux Libertine]] ({{Pkg|ttf-linux-libertine}}) - Unicode: Latin, Greek, Cyrillic, Hebrew
 +
* [[Wikipedia:Times New Roman|Times New Roman]] ({{AUR|ttf-ms-fonts}})
 +
* Tinos ({{AUR|ttf-chromeos-fonts}} or {{AUR|ttf-google-fonts-git}}) - Chrome/Chromium OS replacement for Times New Roman (metric-compatible)
  
A console font is limited to either 256 or 512 characters. The fonts are found in {{ic|/usr/share/kbd/consolefonts/}}.
+
==== Unsorted ====
  
''Keymaps, ''the connection between the key pressed and the character used by the computer, are found in the subdirectories of {{ic|/usr/share/kbd/keymaps/}}.
+
{{Style|This section should be absorbed into the Monospace/Serif/Sans-Serif structure}}
  
=== Previewing and testing ===
+
* {{Pkg|font-bh-ttf}} - X.Org Luxi fonts
 +
* {{Pkg|ttf-cheapskate}} - Font collection from ''dustismo.com''
 +
* {{Pkg|ttf-junicode}} - Junius font containing almost complete medieval latin script glyphs
 +
* {{Pkg|ttf-mph-2b-damase}} - Covers full plane 1 and several scripts
 +
* {{Pkg|xorg-fonts-type1}} - IBM Courier and Adobe Utopia sets of [[Wikipedia:PostScript fonts|PostScript fonts]]
 +
* {{AUR|all-repository-fonts}} - Meta package for all fonts in the official repositories.
 +
* {{AUR|ttf-google-fonts-git}} - a huge collection of free fonts (including ubuntu, inconsolata, droid, etc.) - Note: Your font dialog might get very long as >100 fonts will be added.
  
An organized library of images for previewing is available at http://alexandre.deverteuil.net/consolefonts/consolefonts.html.
+
=== Non-latin scripts ===
  
Moreover, the user can use {{ic|setfont}} to temporarily change the font and be able to consider its use as the default. The available ''glyphs ''or letters in the font can also be viewed as a table with the command {{ic|showconsolefont}}.
+
==== Ancient Scripts ====
  
If the newly changed font is not suitable, a return to the default font is done by issuing the command {{ic|setfont}} without any arguments. If the console display is totally unreadable, this command will still work—the user just types in {{ic|setfont}} while "working blind."
+
* {{AUR|ttf-ancient-fonts}} - Font containing Unicode symbols for Aegean, Egyptian, Cuneiform, Anatolian, Maya, and Analecta scripts
  
Note that {{ic|setfont}} only works on the console currently being used. Any other consoles, active or inactive, remain unaffected.
+
==== Arabic ====
  
==== Examples ====
+
* {{AUR|ttf-amiri}} - A classical Arabic typeface in Naskh style poineered by Amiria Press
 +
* {{AUR|ttf-arabeyes-fonts}} - Collection of free Arabic fonts
 +
* {{AUR|ttf-qurancomplex-fonts}} - Fonts by King Fahd Glorious Quran Printing Complex in al-Madinah al-Munawwarah
 +
* {{AUR|ttf-sil-lateef}} - Unicode Arabic font from SIL
 +
* {{AUR|ttf-sil-scheherazade}} - Unicode Arabic font from SIL
  
Change the font. This example is distinctive:
+
==== Braille ====
$ setfont /usr/share/kbd/consolefonts/gr737b-9x16-medieval.psfu.gz
+
  
Or change the font to one with 512 glyphs and set the keymap to ''ISO 8859-5'' using the {{ic|-m}} option:
+
*{{Pkg|ttf-ubraille}} - Font containing Unicode symbols for ''braille''
$ setfont /usr/share/kbd/consolefonts/LatArCyrHeb-16.psfu.gz -m 8859-5
+
  
Then issue commands that send text to the display, perhaps view a ''manpage'' and try ''vi'' or ''nano'', and view the table of glyphs with the command, {{ic|showconsolefont}}.
+
==== Chinese, Japanese, Korean, Vietnamese ====
  
Return to the default font with:
+
===== Pan-CJK =====
$ setfont
+
  
=== Changing the default font ===
+
* {{Pkg|adobe-source-han-sans-otc-fonts}} - Large collection of fonts which comprehensively support Simplified Chinese, Traditional Chinese, Japanese, and Korean, with a consistent design and look.
 +
* {{Pkg|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 {{Pkg|adobe-source-han-sans-otc-fonts}}.
  
To change the default font, the {{ic|FONT<nowiki>=</nowiki>}} and {{ic|FONT_MAP<nowiki>=</nowiki>}} settings in {{ic|/etc/vconsole.conf}} (this file may need to be created) must be altered. Again, the fonts can be found in {{ic|/usr/share/kbd/consolefonts/}} directory and keymaps can be found in the subdirectories of {{ic|/usr/share/kbd/keymaps/}}.
+
===== Chinese =====
  
==== Examples ====
+
* {{Pkg|adobe-source-han-sans-cn-fonts}} - Simplified Chinese OpenType/CFF fonts
For displaying characters such as ''Č, ž, đ, š'' or ''Ł, ę, ą, ś'' using the font {{ic|lat2-16.psfu.gz}}:
+
* {{Pkg|adobe-source-han-sans-tw-fonts}} - Traditional Chinese OpenType/CFF fonts
CONSOLEFONT="lat2-16"
+
* {{Pkg|ttf-arphic-ukai}} - ''Kaiti'' (brush stroke) Unicode font (enabling anti-aliasing is suggested)
It means that second part of ISO/IEC 8859 characters are used with size 16. You can change font size using other values like lat2-08...16. For the regions determined by 8859 specification, look at the [http://en.wikipedia.org/wiki/ISO/IEC_8859#The_Parts_of_ISO.2FIEC_8859 Wikipedia]. You can use a Terminus font which is recommended if you work a lot in console without X server. ter-216b for example is latin-2 part, size 16, bold. ter-216n is the same but normal weight. Terminus fonts have sizes up to 32.
+
* {{Pkg|ttf-arphic-uming}} - ''Mingti'' (printed) Unicode font
 +
* {{Pkg|opendesktop-fonts}} - ''New Sung'' font, previously is ttf-fireflysung package
 +
* {{Pkg|wqy-microhei}} - A Sans-Serif style high quality CJKV outline font.
 +
* {{Pkg|wqy-zenhei}} - Hei Ti Style (sans-serif) Chinese Outline font embedded with bitmapped Song Ti (also supporting Japanese (partial) and Korean characters).
 +
* {{Pkg|wqy-bitmapfont}} - Bitmapped Song Ti (serif) Chinese font
 +
* {{AUR|ttf-i.bming}} - CJK serif font that emphasis on an old-style typeface
 +
* {{AUR|ttf-tw}} - Kai and Song traditional Chinese font from the Ministry of Education of Taiwan
  
Now, set the proper keymap, for lat2-16 it will be:
+
===== Japanese =====
CONSOLEMAP="8859-2"
+
  
To use the specified font in early userspace, that is, early in the bootup process, add the {{ic|consolefont}} hook to {{ic|/etc/mkinitcpio.conf}}:
+
* {{Pkg|adobe-source-han-sans-jp-fonts}} - Japanese OpenType/CFF fonts
HOOKS="base udev autodetect pata scsi sata filesystems '''consolefont''' '''keymap'''"
+
* {{Pkg|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.
 +
* {{Pkg|ttf-hanazono}} - A free Japanese kanji font, style Mincho (serif).
 +
* {{Pkg|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.
 +
* {{AUR|ttf-koruri}} - Japanese TrueType font obtained by mixing {{AUR|ttf-mplus}} and Open Sans
 +
* {{AUR|ttf-monapo}} - Japanese fonts to show [[wikipedia:2channel_Shift_JIS_art|2channel Shift JIS art]] properly.
 +
* {{AUR|ttf-mplus}} - 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).
 +
* {{AUR|ttf-vlgothic}} - Japanese Gothic fonts. Default of Debian/Fedora/Vine Linux
  
Then rebuild the image:
+
===== Korean =====
# mkinitcpio -p linux
+
  
{{Note|The above steps must be repeated for each kernel if more than one kernel package is installed.}}
+
* {{Pkg|adobe-source-han-sans-kr-fonts}} - Korean OpenType/CFF fonts
 +
* {{Pkg|ttf-baekmuk}} - Collection of Korean TrueType fonts
 +
* {{AUR|spoqa-han-sans}} - Source Han Sans customized by Spoqa
 +
* {{AUR|ttf-d2coding}} - D2Coding fixed width TrueType font made by Naver
 +
* {{AUR|ttf-nanum}} - Nanum series TrueType fonts
 +
* {{AUR|ttf-nanumgothic_coding}} - Nanum series fixed width TrueType fonts
  
See [[Mkinitcpio#HOOKS]] for more information.
+
===== Vietnamese =====
  
==== Boot Error ====
+
* {{Pkg|ttf-hannom}} - Vietnamese TrueType font for chữ Nôm characters
  
If "Loading Console Font" fails at boot time, this is probably because you didn't choose a valid font during your archlinux install.
+
==== Cyrillic ====
  
To get rid of this message, simply empty the CONSOLEFONT var in /etc/rc.conf (CONSOLEFONT=). It will fallback on default font at boot.
+
See also [[#Latin script]].
 +
 
 +
* {{AUR|ttf-paratype}} - Font family by ParaType: sans, serif, mono, extended cyrillic and latin, OFL license
 +
* {{AUR|otf-russkopis}} - 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:
 +
 
 +
* {{AUR|otf-gfs}} - Selection of OpenType fonts from the Greek Font Society
 +
* {{AUR|ttf-mgopen}} - Professional TrueType fonts from Magenta
 +
 
 +
==== Hebrew ====
 +
 
 +
* {{AUR|culmus}} - Nice collection of free Hebrew fonts
 +
 
 +
==== Indic ====
 +
 
 +
* {{Pkg|ttf-freebanglafont}} - Font for Bangla
 +
* {{Pkg|ttf-indic-otf}} - Indic OpenType Fonts collection (containing ttf-freebanglafont)
 +
: (This one contains a "look of disapproval" that might be more to your liking than the {{Pkg|bdf-unifont}} one mentioned elsewhere in this document)
 +
* {{AUR|lohit-fonts}} - Indic TrueType fonts from Fedora Project (containing Oriya Fonts and more)
 +
* {{AUR|ttf-devanagarifonts}} - Devanagari TrueType fonts (contains 283 fonts)
 +
* {{AUR|ttf-gurmukhi-fonts_sikhnet}} - TrueType Gurmukhi fonts (gurbaniwebthick,prabhki)
 +
* {{AUR|ttf-gurmukhi_punjabi}} - TTF Gurmukhi / Punjabi (contains 252 fonts)
 +
* {{AUR|ttf-gujrati-fonts}} - TTF Gujarati fonts (Avantika,Gopika,Shree768)
 +
* {{AUR|ttf-kannada-font}} - Kannada, the language of Karnataka state in India
 +
* {{AUR|ttf-lklug}} - Sinhala Unicode font
 +
* {{AUR|ttf-tamil}} - Tamil Unicode fonts
 +
* {{AUR|ttf-urdufonts}} - 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
 +
 
 +
==== Khmer ====
 +
 
 +
* {{Pkg|ttf-khmer}} - Font covering glyphs for Khmer language
 +
* [https://www.google.com/fonts/specimen/Hanuman Hanuman] ({{AUR|ttf-google-fonts-git}})
 +
 
 +
==== Mongolic and Tungusic ====
 +
 
 +
* {{AUR|ttf-abkai}} - Fonts for Sibe, Manchu and Daur scripts (incomplete, currently in development)
 +
 
 +
==== Persian ====
 +
 
 +
* {{AUR|persian-fonts}} - Meta package for installing all Persian fonts in AUR.
 +
* {{AUR|ttf-borna}} - Borna Rayaneh Persian B font series.
 +
* {{AUR|ttf-iran-nastaliq}} - A free Unicode calligraphic Persian font created by Iran Supreme Council of Information and Communication Technology (SCICT).
 +
* {{AUR|ttf-iranian-sans}} and {{AUR|ttf-iranian-serif}} - A family of fonts, designed by support from Iranian National Initiative for Free and Open Source Software to provide a good looking and free font for Persian script.
 +
* {{AUR|ttf-irfonts}} - Iran Supreme Council of Information and Communication Technology (SCICT) standard Persian fonts series.
 +
* {{AUR|ttf-persian-hm-ftx}} - An improved and corrected font series derived from {{AUR|ttf-x2}} Persian font series, Metafont and FarsiTeX fonts with Kashida feature.
 +
* {{AUR|ttf-persian-hm-xs2}} - An improved and corrected font series derived from {{AUR|ttf-x2}} Persian font series with Kashida feature.
 +
* {{AUR|ttf-sina}} - Sina Pardazesh Persian font series.
 +
* {{AUR|ttf-vazir}}, {{AUR|ttf-samim}}, {{AUR|ttf-tanha}}, {{AUR|ttf-shabnam}}, {{AUR|ttf-gandom}}, {{AUR|ttf-parastoo}} - Beautiful Persian fonts made by Ali Rasti Kerdar.
 +
* {{AUR|ttf-yas}} - The Yas Persian font series (with '''hollow zero''').
 +
* {{AUR|ttf-x2}} - Free fonts with support for Persian, Arabic, Urdu, Pashto, Dari, Uzbek, Kurdish, Uighur, old Turkish (Ottoman) and modern Turkish (Roman).
 +
 
 +
==== Tai–Kadai ====
 +
 
 +
* {{Pkg|ttf-tlwg}}{{Broken package link|replaced by {{Pkg|fonts-tlwg}}}} - Collection of scalable Thai fonts
 +
* {{AUR|ttf-lao}} - Lao TTF font (Phetsarath_OT)
 +
* {{AUR|ttf-lao-fonts}} - Lao TTF fonts, both Unicode and non-Unicode for Windows
 +
 
 +
==== Tibeto-Burman ====
 +
 
 +
* {{Pkg|ttf-tibetan-machine}} - Tibetan Machine TTFont
 +
* {{AUR|ttf-my-paduk}} - Padauk font for Myanmar/Birmania
 +
* {{AUR|ttf-myanmar-fonts}} - 121 Fonts from myordbok.com
 +
 
 +
=== Emoji and symbols ===
 +
 
 +
A section of the Unicode standard is designated for pictographic characters called "emoji".
 +
 
 +
* {{Pkg|noto-fonts-emoji}} - Google's own emoji font, like on Android or Google Hangouts. Some newer additions to Unicode appear to render poorly with Noto fonts.
 +
* {{Pkg|ttf-symbola}} - provides many Unicode symbols, including emoji, in outline style.
 +
* {{AUR|ttf-emojione-color}} - a color and B&W emoji SVGinOT font built from EmojiOne (It's the same as {{AUR|emojione-color-font}} but with less harmfull configurations).
 +
* {{AUR|emojione-color-font}} - a complete, independent, open-source emoji set focused on design correctness.
 +
* {{AUR|twemoji-color-font}} - Twitter's open-sourced emoji glyphs.
 +
 
 +
[[wikipedia:Emoticon#Japanese_style|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: {{Pkg|ttf-freefont}}, {{Pkg|ttf-arphic-uming}}, and {{Pkg|ttf-indic-otf}}.
 +
 
 +
=== Math ===
 +
 
 +
* {{Pkg|font-mathematica}} - Mathematica fonts by Wolfram Research, Inc.
 +
* {{Pkg|texlive-core}} and {{Pkg|texlive-fontsextra}} contain many math fonts such as Latin Modern Math and [[Wikipedia:STIX Fonts project|STIX Fonts]]. See [[TeX Live#Fonts]] for configuration.
 +
* {{AUR|otf-latin-modern}}, {{AUR|otf-latinmodern-math}} - Improved version of Computer Modern fonts as used in LaTeX
 +
* {{AUR|otf-xits}} - An OpenType implementation of [[Wikipedia:STIX Fonts project|STIX Fonts]] with support for maths written from right to left.
 +
* {{AUR|ttf-computer-modern-fonts}}, {{AUR|otf-cm-unicode}} - [[wikipedia:Computer Modern|Computer Modern]] (of TeX fame)
 +
* {{AUR|ttf-mathtype}} - MathType fonts
 +
 
 +
=== Other operating system fonts ===
 +
 
 +
* {{AUR|ttf-mac-fonts}} - Apple MacOS TrueType fonts
 +
 
 +
See [[Metric-compatible fonts]], which lists available alternatives for [[Microsoft fonts]].
  
 
== Fallback font order with X11 ==
 
== 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 doesn't support it.
 
  
Fontconfig lets every user configure the order they want via {{ic|~/.fonts.conf}}.
+
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.
If you want a particular Chinese font to be selected after your favorite Serif font, your file would look like that:
+
 
  <?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+
Fontconfig lets every user configure the order they want via {{ic|$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>
 
  <fontconfig>
 
  <alias>
 
  <alias>
Line 427: Line 506:
 
  </fontconfig>
 
  </fontconfig>
  
You can add a section for Sans-serif and monospaced as well. For more informations, have a look at the fontconfig manual.
+
{{Tip|If you use a Chinese locale, set {{ic|LC_LANG}} to {{ic|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 informations, have a look at the fontconfig manual.
 +
 
 +
See also [[Font configuration#Replace or set default fonts]].
  
 
== Font alias ==
 
== Font alias ==
In Linux there are several fonts that are aliases to other fonts so that programs will be using similar fonts. The most common ones are {{ic|sans}} for a font of the sans type, {{ic|sans-serif}} for a font of the sans-serif type and {{ic|monospace}} for a monospaced font. However which fonts these are aliased to may vary and often doesn't show in font management tools like those found in KDE and other desktop environments.
 
  
To reverse the alias and find which fonts the aliases are representing run:
+
There are several font aliases which represent other fonts in order that applications may use similar fonts. The most common aliases are: {{ic|serif}} for a font of the serif type (e.g. DejaVu Serif); {{ic|sans-serif}} for a font of the sans-serif type (e.g. DejaVu Sans); and {{ic|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]].
fc-match monospace
+
 
VeraMono.ttf: "Bitstream Vera Sans Mono" "Roman"
+
To reverse an alias and find which font it is representing, run:
Where in this case VeraMono.ttf would be the font monospace is aliased as.
+
 
 +
{{hc|$ fc-match monospace|
 +
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
 +
}}
 +
 
 +
In this case, {{ic|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 fonts that are available on your system.
 +
 
 +
$ fc-list
 +
 
 +
=== Lists 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 {{ic|<nowiki>fc-list :lang="two letter language code"</nowiki>}}. For instance, to list installed Arabic fonts or fonts supporting Arabic glyph:
 +
{{hc|$ fc-list -f '%{file}\n' :lang&#61;ar|2=
 +
<nowiki>
 +
/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
 +
</nowiki>
 +
}}
 +
 
 +
=== Set terminal font on-the-fly ===
 +
 
 +
{{Expansion|Which terminals specifically support this method? Where is the documentation for the escape codes?}}
 +
 
 +
For terminal emulators that use {{ic|Xresources}}, fonts can be set by using escape sequences. Specifically, echo {{ic|\033]710;$font\007}} to change the normal font ({{ic|*font}} in {{ic|~/.Xresources}}), and replace {{ic|710}} with {{ic|711}}, {{ic|712}}, and {{ic|713}} to change the {{ic|*boldFont}}, {{ic|*italicFont}}, and {{ic|*boldItalicFont}}, respectively.
 +
 
 +
{{ic|$font}} can be anything the terminal emulator will support.
 +
 
 +
=== Application-specific font cache ===
 +
 
 +
Matplotlib ({{pkg|python-matplotlib}} or {{pkg|python2-matplotlib}}) uses its own font cache, so after updating fonts, be sure to remove {{ic|$HOME/.matplotlib/fontList.cache}},
 +
{{ic|$HOME/.cache/matplotlib/fontList.cache}}, {{ic|$HOME/.sage/matplotlib-1.2.1/fontList.cache}}, etc. so it will regenerate its cache and find the new fonts [http://matplotlib.1069221.n5.nabble.com/getting-matplotlib-to-recognize-a-new-font-td40500.html].
 +
 
 +
== See also ==
 +
 
 +
* [http://behdad.org/text/ State of Text Rendering]

Latest revision as of 12:08, 5 December 2016

From Wikipedia: "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.

Common extensions

  • bdf and bdf.gz – bitmap fonts, bitmap distribution format and gzip compressed bdf
  • pcf and pcf.gz – bitmaps, portable compiled font and gzip compressed pcf
  • psf, psfu, psf.gz and psfu.gz – bitmaps, PC screen font, PC screen font Unicode and the gzipped versions (not compatible with X.Org)
  • pfa and pfb – outline fonts, PostScript font ASCII and PostScript font binary. PostScript fonts carry built-in printer instructions.
  • ttf – outline, TrueType font. Originally designed as a replacement for the PostScript fonts.
  • otf – outline, OpenType font. TrueType with PostScript typographic instructions.

For most purposes, the technical differences between TrueType and OpenType can be ignored, some fonts with a ttf extension are actually OpenType fonts.

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, 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 using:

$ pacman -Ss font

Or to search for ttf fonts only:

$ pacman -Ss 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. Here is an example of how to create a basic package. To learn more about building packages, read PKGBUILD.

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 the FcPatternFormat(3) manual.

PKGBUILD
pkgname=fontname-fonts
pkgver=1.0
pkgrel=1
pkgdesc="Some description"
arch=(any)
depends=(fontconfig xorg-font-utils)
source=("http://someurl.org/$pkgname.tar.bz2")
install=$pkgname.install

package() {
  install -Dm644 $pkgname/font.otf "$pkgdir"/usr/share/fonts/family_name/font.otf
  install -Dm644 $pkgname/font_bold.otf "$pkgdir"/usr/share/fonts/family_name/font_bold.otf
}
fontname-fonts.install
post_install() {
  fc-cache -s
}

post_upgrade() {
  post_install
}

post_remove() {
  post_install
}

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 do 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"

Console fonts

Note: This section is about the Linux console. For alternative console solutions offering more features (full Unicode fonts, modern graphics adapters etc.), see fbterm, KMSCON or similar projects.

By default, the virtual console uses the kernel built-in font with a CP437 character set,[1] but this can be easily changed.

The Linux console uses UTF-8 encoding by default, but because the standard VGA-compatible framebuffer is used, a console font is limited to either a standard 256, or 512 glyphs. If the font has more than 256 glyphs, the number of colours is reduced from 16 to 8. In order to assign correct symbol to be displayed to the given Unicode value, a special translation map, often called unimap, is needed. Nowadays most of the console fonts have the unimap built-in, historically it had to be loaded separately.

The kbd package provides tools to change virtual console font and font mapping. Available fonts are saved in the /usr/share/kbd/consolefonts/ directory, those ending with .psfu or .psfu.gz have a Unicode translation map built-in.

Keymaps, the connection between the key pressed and the character used by the computer, are found in the subdirectories of /usr/share/kbd/keymaps/, see Keyboard configuration in console for details.

Note: Replacing the font can cause issues with programs that expect a standard VGA-style font, such as those using line drawing graphics.
Tip: For European based languages written in Latin/Greek letters you can use eurlatgr font, it includes a broad range of Latin/Greek letter variations as well as special characters [2].

Preview and temporary changes

Tip: An organized library of images for previewing is available: Linux console fonts screenshots.
$ showconsolefont

shows a table of glyphs or letters of a font.

setfont temporarily change the font if passed a font name (in /usr/share/kbd/consolefonts/) such as

$ setfont lat2-16 -m 8859-2

Font names are case-sensitive. With no parameter, setfont returns the console to the default font.

Tip: All font changing commands can be typed in "blind".
Note: setfont only works on the console currently being used. Any other consoles, active or inactive, remain unaffected.

Persistent configuration

The FONT variable in /etc/vconsole.conf is used to set the font at boot, persistently for all consoles. See man 5 vconsole.conf for details.

For displaying characters such as Č, ž, đ, š or Ł, ę, ą, ś using the font lat2-16.psfu.gz:

/etc/vconsole.conf
...
FONT=lat2-16
FONT_MAP=8859-2

It means that second part of ISO/IEC 8859 characters are used with size 16. You can change font size using other values (e.g. lat2-08). For the regions determined by 8859 specification, look at the Wikipedia table.

To use the specified font in early userspace, use the consolefont hook in /etc/mkinitcpio.conf. See Mkinitcpio#HOOKS for more information.

If the fonts seems to not change on boot, or change only temporarily, it is most likely that they got reset when graphics driver was initialized and console was switched to framebuffer. To avoid this, load your graphics driver earlier. See for example Kernel mode setting#Early KMS start, [3] or other ways to setup your framebuffer before /etc/vconsole.conf is applied.

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.

Github user Ternstor has created a python script that generates HTML documents with PNG images of all the fonts in the AUR and the official repositories: [4].

Latin script

Monospaced

Here are some suggestions. Every user has their own favorite, so experiment to find yours. If you are in a hurry, you read Dan Benjamin's blog post: Top 10 Programming Fonts.

Here is a long list of fonts by Trevor Lowing: http://www.lowing.org/fonts/.

A comparison with images on Slant: What are the best programming fonts?

And a Stack Overflow question with some images: Recommended fonts for programming

TrueType
Bitmap

Sans-serif

Serif

Unsorted

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements.Tango-edit-clear.png

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

Non-latin scripts

Ancient Scripts

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

Arabic

Braille

Chinese, Japanese, Korean, Vietnamese

Pan-CJK
  • adobe-source-han-sans-otc-fonts - Large collection of fonts which comprehensively support Simplified Chinese, Traditional Chinese, Japanese, and Korean, with a consistent design and look.
  • 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
Japanese
  • 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
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

  • culmusAUR - Nice collection of free Hebrew fonts

Indic

(This one contains a "look of disapproval" that might be more to your liking than the bdf-unifont one mentioned elsewhere in this document)
  • 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

Khmer

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.
  • ttf-bornaAUR - Borna Rayaneh Persian B font series.
  • ttf-iran-nastaliqAUR - A free Unicode calligraphic Persian font created by Iran Supreme Council of Information and Communication Technology (SCICT).
  • ttf-iranian-sansAUR and ttf-iranian-serifAUR - A family of fonts, designed by support from Iranian National Initiative for Free and Open Source Software to provide a good looking and free font for Persian script.
  • ttf-irfontsAUR - Iran Supreme Council of Information and Communication Technology (SCICT) standard Persian fonts series.
  • ttf-persian-hm-ftxAUR - An improved and corrected font series derived from ttf-x2AUR Persian font series, Metafont and FarsiTeX fonts with Kashida feature.
  • ttf-persian-hm-xs2AUR - An improved and corrected font series derived from ttf-x2AUR Persian font series with Kashida feature.
  • ttf-sinaAUR - Sina Pardazesh Persian font series.
  • ttf-vazirAUR, ttf-samimAUR, ttf-tanhaAUR, ttf-shabnamAUR, ttf-gandomAUR, ttf-parastooAUR - 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

Tibeto-Burman

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. Some newer additions to Unicode appear to render poorly with Noto fonts.
  • ttf-symbola - provides many Unicode symbols, including emoji, in outline style.
  • ttf-emojione-colorAUR - a color and B&W emoji SVGinOT font built from EmojiOne (It's the same as emojione-color-fontAUR but with less harmfull configurations).
  • emojione-color-fontAUR - a complete, independent, open-source emoji set focused on design correctness.
  • twemoji-color-fontAUR - 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: ttf-freefont, ttf-arphic-uming, and ttf-indic-otf.

Math

Other operating system 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 informations, 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 fonts that are available on your system.

$ fc-list

Lists 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

Set terminal font on-the-fly

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: Which terminals specifically support this method? Where is the documentation for the escape codes? (Discuss in Talk:Fonts#)

For terminal emulators that use Xresources, fonts can be set by using escape sequences. Specifically, echo \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 can be anything the terminal emulator will support.

Application-specific font cache

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

See also