Difference between revisions of "Fonts"

From ArchWiki
Jump to navigation Jump to search
Line 230: Line 230:
*Dina ({{Package Official|dina-font}})
*Dina ({{Package Official|dina-font}})
*DejaVu fonts ({{Package Official|ttf-dejavu}})
*DejaVu fonts ({{Package Official|ttf-dejavu}})
*Droid Sans Mono  ({{Package AUR|ttf-droid}})
*Envy Code R ({{Package AUR|ttf-envy-code-r}})
*Envy Code R ({{Package AUR|ttf-envy-code-r}})
Line 235: Line 236:
*Inconsolata-g (adds some programmer-friendly modifications) ({{Package AUR|ttf-inconsolata-g}})
*Inconsolata-g (adds some programmer-friendly modifications) ({{Package AUR|ttf-inconsolata-g}})
*Liberation Mono ({{Package Official|ttf-liberation}})
*Liberation Mono ({{Package Official|ttf-liberation}})
*Lime ({{Package Official|artwiz-fonts}})
*Lucida Typewriter
*Lucida Typewriter
*Monaco ({{Package AUR|monaco_linux}})
*Monaco ({{Package AUR|monaco_linux}})
Line 241: Line 243:
*Proggy fonts ({{Package AUR|proggyfonts}})
*Proggy fonts ({{Package AUR|proggyfonts}})
*Terminus  ({{Package Official|terminus-font}})
*Terminus  ({{Package Official|terminus-font}})
*Lime ({{Package Official|artwiz-fonts}})
*Unifont ({{Package Official|bdf-unifont}})
==Console fonts==
==Console fonts==

Revision as of 07:30, 2 May 2010

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary text Template:Article summary heading Template:Article summary wiki: Font setup and beautification Template:Article summary wiki: Fonts specific to Sun's Java machine Template:Article summary wiki: Adding Microsoft fonts and mimicking Windows' font settings Template:Article summary end

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.

Common font filename extensions include:

For most purposes, the technical differences between TrueType and OpenType can be ignored, some fonts with a Template:Codeline 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 Template:Codeline, Template:Codeline, Template:Codeline and Template:Codeline.

FontForge, a font editing application, can store fonts in its native text-based format, Template:Codeline, spline font database.


Various methods of installing fonts.


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 Template:Codeline fonts only:

# pacman -Ss ttf

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.

depends=('fontconfig' 'xorg-font-utils')
pkgdesc="custom fonts"

  mkdir -p $pkgdir/usr/share/fonts/TTF
  cp $srcdir/$pkgname/*.ttf $pkgdir/usr/share/fonts/TTF

This PKGBUILD assumes the fonts are TrueType. An install file (Template:Filename) will also need to be created to update the font cache:

  echo -n "Updating font cache... "
  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"

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.

To install fonts system-wide (available for all users), move the folder to the Template:Filename directory. To install fonts for only a single user, use Template:Filename instead.

Also you may need to update Template:Filename with the new directory. Search for Template:Codeline to find the correct location within the file to add your new path.

Then update the fontconfig font cache:

$ fc-cache -vf

Older applications

With older applications that do not support fontconfig (e.g. GTK1 applications, and Template:Codeline) 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

At times the X server may fail to load the fonts directory and you will need to rescan all the Template:Filename 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

Font packages

This is a selective list that includes many font packages from the AUR along with those in the official repositories.



Chinese, Japanese, Korean, Vietnamese


See: #Unicode below












Some recommendations for different types of uses.

International users

Template:Package AUR (Hei Ti embedded with bitmapped Song Ti, also supporting Japanese (partial) and Korean characters), Template:Package AUR (Kai Ti) , Template:Package AUR (Song Ti, supporting Vietnamese characters)
Template:Package AUR (IPA fonts), Template:Package AUR (Takao fonts)
Template:Package AUR

Desktop environments



Here are some suggestions. Every user has their own preference, experiment to find one that suits you. If you won't like to try one by one, there's an opinion from Dan Benjamin on his blog: Top 10 Programming Fonts.

Here's a big list of fonts by Trevor Lowing: http://www.lowing.org/fonts/

Console fonts

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.

A console font is limited to either 256 or 512 characters. The fonts are found in Template:Filename. Keymaps, the connection between the key pressed and the character used by the computer, are found in the subdirectories of Template:Filename.

Previewing and testing

Unfortunately, no organized library of images is available to preview console fonts. The user can, however, use Template:Codeline 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 Template:Codeline.

If the newly changed font is not suitable, a return to the default font is done by issuing the command Template:Codeline without any arguments. If the console display is totally unreadable, this command will still work—the user just types in Template:Codeline while "working blind."

Note that Template:Codeline only works on the console currently being used. Any other consoles, active or inactive, remain unaffected.


Change the font. This example is distinctive:

$ 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 Template:Codeline option:

$ 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, Template:Codeline.

Return to the default font with:

$ setfont

Changing the default font

To change the default font, the Template:Codeline and Template:Codeline settings in Template:Filename must be altered. Again, the fonts can be found in Template:Filename directory and keymaps can be found in the subdirectories of Template:Filename.


For displaying characters such as Č, ž, đ, or š, using the font Template:Filename:


Set the proper keymap, in this case:


To use the specified font in early userspace, that is, early in the bootup process, add the Template:Codeline hook to Template:Filename:

HOOKS="base udev autodetect pata scsi sata filesystems consolefont"

Then rebuild the image:

# mkinitcpio -p kernel26
Note: The above steps must be repeated for each kernel if more than one kernel package is installed.

See: Mkinitcpio#Configuring the HOOKS