Differences between revisions 71 and 120 (spanning 49 versions)
Revision 71 as of 2016-04-04 17:10:50
Size: 9178
Editor: ?DamonCook
Comment:
Revision 120 as of 2020-05-25 22:51:08
Size: 11702
Editor: ?GregPrice
Comment: fix package name: freetype2-demos (there doesn't seem to be a freetype-demos)
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:

~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: English - [[fr/Fonts|Français]] - [[ko/Fonts|한국어]] -~
Line 6: Line 9:
Fonts can be added to Debian by installing the appropriate package; fonts are specified in the [[DebianPkg:stable/fonts/|“Fonts” section]].

Note:
 * For most uses, you’ll want TrueType (TTF) and !OpenType (OTF) fonts – these packages start with `fonts-`, `ttf-` or `otf-`.
=== Packages ===
Fonts can be added system-wide
to Debian by installing the appropriate package; fonts are specified in the [[DebianPkg:stable/fonts/|“Fonts” section]].
As default system-wide fonts will be installed into `/usr/share/fonts` by the package-manager.

Notes:
 * For most uses, you’ll want TrueType (TTF) and !OpenType (OTF) fonts – these packages start with `fonts-`.
Line 11: Line 16:
 * Any TTF, OTF, or TTC (!TrueType Collection) files can be manually installed on an ad hoc basis.
   * GNOME way: opening a Nautilus window to `fonts://` and dragging and dropping.
   * Command line: copy a font file into the directory `/usr/local/share/fonts` (for all users) or `~/.fonts` (for a specific user).
 * Remember to verify the font's permissions on disk (644). The fc-cache command, below, is not going to warn you about wrong permissions; incorrect permissions can render installed fonts inaccessible.

=== Manually ===
Install a font manually by downloading the appropriate `.ttf` or `otf` files and placing them into `/usr/local/share/fonts` (system-wide), `~/.local/share/fonts` (user-specific) or `~/.fonts` (user-specific). These files should have the permission `644` (`-rw-r--r--`), otherwise they may not be usable.

Run `fc-cache` to update the font cache (add `-v` for verbose output).
Line 18: Line 23:
You can also verify that the fonts are present by looking for them in an application (such as a word processor), or by using the command `fc-list`.  A python based graphical utility, DebianPkg:font-manager, is also available to preview all installed and available fonts.  If you are installing bit map fonts you might need to enable this with dpkg-reconfigure:
{{{
  # dpkg-reconfigure fontconfig-config
}}}

Then enable bit maps font in the third screen.

GNOME users can simply open a Nautilus window to `fonts://` and drag&drop the font files in there.

You can verify the fonts are present by looking for them in an application (such as a word processor), or by using the command `fc-list`. A python based graphical utility, DebianPkg:font-manager, is also available to preview all installed and available fonts.
Line 25: Line 39:
 * `fc-cache -fv` – rebuilds cached list of fonts  * `fc-match -s helvetica` – show an ordered list of fonts matching a certain name or pattern
 * `fc-cache -fv` – rebuilds cached list of fonts (in `~/.config/fontconfig`, older caches may also be in `~/.fontconfig`)
Line 39: Line 54:
Line 44: Line 60:
== Lists ==

See all the fonts included in Debian at http://pkg-fonts.alioth.debian.org/review/ (updated weekly), http://www.miriamruiz.es/debfonts/ or http://fonts.debian.net/. For usage of Debian fonts on Windows or Mac OS X, see http://fonts.debian.net/. Various libre fonts are [[Fonts/Missing|missing]] from Debian and need to be packaged.

email lists: [[http://lists.alioth.debian.org/mailman/listinfo/cjkunifonts-devel|CJKUnifonts-devel]] [[http://lists.alioth.debian.org/mailman/listinfo/cjkunifonts-hakkaim|CJKUnifonts-HakkaIM]] [[http://lists.alioth.debian.org/mailman/listinfo/cjkunifonts-minnanim|CJKUnifonts-MinnanIM]] [[http://lists.alioth.debian.org/mailman/listinfo/freefont-devel|freefont-devel]] [[http://lists.alioth.debian.org/mailman/listinfo/pkg-fonts-bugs|pkg-fonts-bugs]] [[http://lists.alioth.debian.org/mailman/listinfo/pkg-fonts-commits|pkg-fonts-commits]] [[http://lists.alioth.debian.org/mailman/listinfo/pkg-fonts-devel|pkg-fonts-devel]]

== Commonly Used Fonts ==

The DebianPkg:fonts-liberation ([[DebianPkg:squeeze/ttf-liberation|ttf-liberation]] in squeeze) package supplies fonts with the same metrics as Times, Arial and Courier. These fonts are named '''Liberation''' and are present in most cases. If you require the non-free original Microsoft fonts the DebianPkg:ttf-mscorefonts-installer package (in contrib) can be used to obtain them.

East Asian fonts: DebianPkg:ttf-arphic-uming DebianPkg:ttf-wqy-zenhei DebianPkg:ttf-sazanami-mincho DebianPkg:ttf-sazanami-gothic DebianPkg:ttf-unfonts-core
== Font lists ==

The page http://www.miriamruiz.es/debfonts/ displays the fonts contained in some packages, but the list of packages and fonts isn't updated any more.

The [[http://pkg-fonts.alioth.debian.org/review/|Debian Fonts Review]] [[Services/DebianFontReview|service]] [[https://lists.alioth.debian.org/pipermail/pkg-fonts-devel/2016-September/018319.html|needs]] to be [[https://lists.alioth.debian.org/pipermail/pkg-fonts-devel/2016-September/018325.html|revived]].

The [[https://web.archive.org/web/20160303215740/http://fonts.debian.net/|Free Font Compilation]] is is also no longer updated.

Various libre fonts are [[Fonts/Missing|missing]] from Debian and need to be packaged.

=== Commonly Used Fonts ===

The DebianPkg:fonts-liberation package supplies fonts with the same metrics as Times, Arial and Courier. These fonts are named '''Liberation''' and are present in most cases. If you require the non-free original Microsoft fonts the DebianPkg:ttf-mscorefonts-installer package (in contrib) can be used to obtain them.

East Asian fonts: DebianPkg:fonts-arphic-uming DebianPkg:fonts-wqy-zenhei DebianPkg:fonts-sazanami-mincho DebianPkg:fonts-sazanami-gothic DebianPkg:fonts-unfonts-core
Line 60: Line 80:
== Debian Fonts Task Force ==

http://pkg-fonts.alioth.debian.org/
== Troubleshooting ==

If fonts do not display properly, you may want to make sure the right font gets loaded, for example with:

{{{
fc-match -s Helvetica
}}}

If it doesn't, you may want to regenerate the caches with:

{{{
dpkg-reconfigure fontconfig fontconfig-config
}}}

You can also run this as a user with `fc-cache -fv`.

Otherwise, you can also look at the font in a viewer like DebianPkg:font-manager.

Individual font rendering can be tested directly with the `ftview` program available in the DebianPackage:freetype2-demos package. For example, here is how to show sample glyphs from the [[https://en.wikipedia.org/wiki/Liberation_fonts|Liberation]] Mono font using the 3.5 and [[https://www.freetype.org/freetype2/docs/subpixel-hinting.html|4.0 rendering engines]]:

{{{
FREETYPE_PROPERTIES="truetype:interpreter-version=35" ftview 16 /usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf &
FREETYPE_PROPERTIES="truetype:interpreter-version=40" ftview 16 /usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf &
}}}

This was quite useful to diagnose changes in the engine after the Debian buster upgrade, described in DebianBug:866685.
<<Anchor(bugs)>>
Line 68: Line 111:
<<Anchor(rfn-violation)>>
Line 70: Line 114:
<<Anchor(render)>>
Line 72: Line 118:
The pkg-fonts team will use these tags for usertags ([[http://bugs.debian.org/cgi-bin/pkgreport.cgi?users=pkg-fonts-devel@lists.alioth.debian.org|user: pkg-fonts-devel@lists.alioth.debian.org]]) The fonts team will use these tags for usertags ([[http://bugs.debian.org/cgi-bin/pkgreport.cgi?users=pkg-fonts-devel@lists.alioth.debian.org|user: pkg-fonts-devel@lists.alioth.debian.org]])
Line 76: Line 122:
 * [[/Bugs/rfn-violation|rfn-violation]]: for packages that contain OFL fonts with a Reserved Font Name that have not been renamed or have lost the upstream RFN notice (severity serious)
 * [[/Bugs/contrib|contrib]]: for packages that contain free fonts that cannot be built with free tools (severity serious)
Line 81: Line 129:
== Source Font Formats ==

sfd (fontforge's ascii file format for vector fonts)
UFO ([[http://unifiedfontobject.org/|Unified Font Object]])

== Generating Fonts from Source ==

The DebianPkg:fontforge is an editor for outline and bitmap fonts that generates all kinds of fonts. It is also scriptable and has an addon tool DebianPkg:xgridfit for hinting. The following fonts are built from sfd (found using apt-cache rdepends fontforge):

 * DebianPkg:ttf-junicode
 * [[DebianPkg:ttf-beteckna|beteckna]]
 * [[DebianPkg:ttf-essays1743|essays1743]]
 * DebianPkg:ttf-atarismall
 * DebianPkg:ttf-breip

I created some script to create bold, italic, and condensed typefaces out of sfd fonts:

[[http://gnu.ethz.ch/linuks.mine.nu/beteckna/beteckna-0.2/|sfd2*.ff]]

== Font Formats ==
<<Anchor(formats)>>
== Font design and formats ==

<<Anchor(source-formats)>>
=== Source Font Formats ===

 * SFD ([[https://fontforge.github.io/sfdformat.html|Spline Font Database]], FontForge's ASCII file format for vector fonts)
 * UFO ([[http://unifiedfontobject.org/|Unified Font Object]])
 * Glyphs (proprietary format of [[https://glyphsapp.com/|Glyphs]])

=== Generating Fonts from Source ===

The upstream build system should always be used for generating fonts. If upstream does not have a build system, then it is a good idea to contribute one to them based on the following Free Software tools.

The DebianPkg:fontforge is an editor for outline and bitmap fonts that generates all kinds of fonts. It is also scriptable and has an addon tool DebianPkg:xgridfit for hinting. Fonts using these tools can be found using these commands:

{{{
apt-cache rdepends fontforge
apt-cache rdepends xgridfit
}}}

There is also DebianPkg:birdfont and DebianPkg:ttfautohint

<<Anchor(output-formats)>>
=== Output Font Formats ===
Line 104: Line 157:
<<Anchor(tools)>>
Line 106: Line 160:
DebianPkg:texlive-font-utils, fttools, ttf2tex, freetype1-tools, ttf2pt1, DebianPkg:otf2bdf, DebianPackage:fonttools

== Subpixel-hinting and Font-smoothing ==

The default fonts in Debian derived distributions like Ubuntu and Linux Mint have better looking fonts when compared to default Debian Squeeze since the ubuntu-based distros have heavily patched cairo or freetype2 whereas Vanilla Debian doesn't do patching as much as they do. A lot of things about the cairo package has changed recently in wheezy and unstable which have brought almost the same font setup to Debian (But not Squeeze or old) but you have to set it up to your liking. You can create a .fonts.conf file to any user account home folder to set this up. Patching and rebuilding of Cairo packages are not needed any more. An example of .fonts.conf which you can add to your user account home folder without altering anything else:
{{{
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <match target="font">
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hintstyle">
   <const>hintslight</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
 </match>
  <match target="font">
    <edit mode="assign" name="lcdfilter">
      <const>lcddefault</const>
    </edit>
  </match>
</fontconfig>
}}}

== Infinality for Debian ==

[[http://www.infinality.net/blog/|Infinality]] font settings and Infinality-freetype are not available for Debian in official repositories and will only be available once Infinality is pushed upstream. There are third party git repos you can use to get the packages working for you. Currently a working third party git repo created by [[https://github.com/chenxiaolong/Debian-Packages.git|chenxiaolong]] is available for all Debian architectures. Infinality font config Debian build instructions with prebuilt binaries for amd64 are available for easy installation in a post in the [[http://forums.debian.net/viewtopic.php?f=16&t=88545|Debian forums]] created by a user.
||''Tool'''||''Debian package'''||'''Comments'''||
|| [[http://www.tug.org/texlive/|texlive-font-utils]] || DebianPkg:texlive-font-utils || Programs for font conversion, testing, and other manipulation. ||
|| fttools || || || ||
|| [[https://www.ctan.org/pkg/ttf2tex|ttf2tex]] || || ||
|| freetype1-tools || || || ||
|| [[http://ttf2pt1.sourceforge.net/|ttf2pt1]] || || Font converter from TrueType to Adobe Type1. ||
|| [[https://www.math.nmsu.edu/~mleisher/Software/otf2bdf/|otf2bdf]] || DebianPkg:otf2bdf || Command line utility that generates BDF bitmap fonts from OpenType fonts. ||
|| [[https://github.com/behdad/fonttools|fonttools]] || DebianPackage:fonttools || A Python library to open and manipulate OTF and TTF files. ||
|| [[https://fontmanager.github.io/|GTK+ Font Manager]] || DebianPkg:font-manager || Python program to show and compare fonts ||
|| [[https://github.com/GNOME/gnome-font-viewer|GNOME Font Viewer]] || DebianPkg:gnome-font-viewer || Simple interface to show a preview of all fonts installed ||

There are several font tools which are not included in Debian, but are used to produce fonts included in Debian:

|| {i} || Available in Debian although not yet in stable. ||
|| {*} || Someone is working on inclusion into Debian. ||
|| {o} || Someone requested inclusion into Debian. ||
|| {X} || Someone needs to [[http://www.debian.org/devel/wnpp/#l1|file an RFP or ITP bugreport]] and update this page with resulting bug number. ||
|| /!\ || Was available in Debian but is not part of stable or unstable. ||

||<style="width: 40%; text-align: left;">'''Tool'''||'''Comments'''||
|| {o} [[https://github.com/typesupply/defcon|defcon]] || DebianBug:806513 ||
|| {o} [[https://github.com/typemytype/booleanOperations|booleanOperations]] || DebianBug:806516 ||
|| {o} [[https://github.com/googlei18n/cu2qu|cu2qu]] || DebianBug:868004 ||
|| {o} [[https://github.com/googlei18n/fontmake|fontmake]] || DebianBug:865283 ||
|| {o} [[https://github.com/googlei18n/glyphsLib|glyphsLib]] || DebianBug:868005 ||
|| {o} [[https://github.com/LettError/MutatorMath|MutatorMath]] || DebianBug:806503 ||
|| {o} [[https://github.com/googlei18n/ufo2ft|ufo2ft]] || DebianBug:868006 ||
|| {X} [[http://shell.aiei.ch/typography/|mkspecimen]] || Font specimen generator, inspired by Wikipedia version ||
|| {X} [[http://phd-sid.ethz.ch/appstream/|debian2appstream]] || AppStream metadata generator for fonts (pregenerated fonts- entries) ||
Line 149: Line 192:
=== Reference manual ===
{{{#!wiki debian
[[https://www.debian.org/doc/manuals/debian-reference/ch07.en.html#_fonts_in_the_x_window|Fonts in the X Window]]}}}

=== Wiki pages ===
Line 151: Line 200:
* [[tahoma]]

=== Other links ===

 * [[https://salsa.debian.org/fonts-team|Salsa Group 'Team Fonts']]
Line 152: Line 206:
 * [[http://wiki.archlinux.org/index.php/Font_Configuration|Font Configuration]], !ArchLinux Wiki – useful general information
Line 154: Line 207:

=== Outdated ===
 * [[https://wiki.archlinux.org/index.php/Fonts|Arch Linux]] fonts documentation

==== Outdated ====
Line 158: Line 212:
 * [[http://pkg-fonts.alioth.debian.org/|Debian Fonts Task Force]]

Translation(s): English - Français - 한국어

Adding fonts

Packages

Fonts can be added system-wide to Debian by installing the appropriate package; fonts are specified in the “Fonts” section. As default system-wide fonts will be installed into /usr/share/fonts by the package-manager.

Notes:

  • For most uses, you’ll want TrueType (TTF) and OpenType (OTF) fonts – these packages start with fonts-.

  • Some non-free font downloader packages are in contrib, which you will need to add to your sources if not present.

Manually

Install a font manually by downloading the appropriate .ttf or otf files and placing them into /usr/local/share/fonts (system-wide), ~/.local/share/fonts (user-specific) or ~/.fonts (user-specific). These files should have the permission 644 (-rw-r--r--), otherwise they may not be usable.

Run fc-cache to update the font cache (add -v for verbose output). The above mentioned paths can be customized in the fontconfig configuration file at /etc/fonts/fonts.conf – you can also include subdirectories or links, which is useful if you have a directory of fonts on a separate hard drive (or partition or other location).

If you are installing bit map fonts you might need to enable this with dpkg-reconfigure:

  # dpkg-reconfigure fontconfig-config

Then enable bit maps font in the third screen.

GNOME users can simply open a Nautilus window to fonts:// and drag&drop the font files in there.

You can verify the fonts are present by looking for them in an application (such as a word processor), or by using the command fc-list. A python based graphical utility, font-manager, is also available to preview all installed and available fonts.

Configuration

fontconfig is the underlying configuration tool; you may find the following programs useful:

  • fc-list – lists fonts

  • fc-match -s helvetica – show an ordered list of fonts matching a certain name or pattern

  • fc-cache -fv – rebuilds cached list of fonts (in ~/.config/fontconfig, older caches may also be in ~/.fontconfig)

To view a list of monospaced client-side fonts (available from Xft, so it is possible to apply font hinting and antialiasing):

  $ fc-list :spacing=mono

To view a list of server-side (available directly from X server, so font hinting and antialiasing are not available) monospaced fonts:

  $ xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-m*'
  $ xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-c*'

You may also find the following useful to change the default font rendering:

  $ dpkg-reconfigure fontconfig-config
  $ dpkg-reconfigure fontconfig

Font lists

The page http://www.miriamruiz.es/debfonts/ displays the fonts contained in some packages, but the list of packages and fonts isn't updated any more.

The Debian Fonts Review service needs to be revived.

The Free Font Compilation is is also no longer updated.

Various libre fonts are missing from Debian and need to be packaged.

Commonly Used Fonts

The fonts-liberation package supplies fonts with the same metrics as Times, Arial and Courier. These fonts are named Liberation and are present in most cases. If you require the non-free original Microsoft fonts the ttf-mscorefonts-installer package (in contrib) can be used to obtain them.

East Asian fonts: fonts-arphic-uming fonts-wqy-zenhei fonts-sazanami-mincho fonts-sazanami-gothic fonts-unfonts-core

(from Wikipedia: Help:Multilingual support (East Asian))

If you want to use non-free fonts like Calibri which originate from Microsoft Office, you can download and install them (gratis) from the Microsoft Powerpoint Viewer.

Troubleshooting

If fonts do not display properly, you may want to make sure the right font gets loaded, for example with:

fc-match -s Helvetica

If it doesn't, you may want to regenerate the caches with:

dpkg-reconfigure fontconfig fontconfig-config

You can also run this as a user with fc-cache -fv.

Otherwise, you can also look at the font in a viewer like font-manager.

Individual font rendering can be tested directly with the ftview program available in the freetype2-demos package. For example, here is how to show sample glyphs from the Liberation Mono font using the 3.5 and 4.0 rendering engines:

FREETYPE_PROPERTIES="truetype:interpreter-version=35" ftview 16 /usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf  &
FREETYPE_PROPERTIES="truetype:interpreter-version=40" ftview 16 /usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf  &

This was quite useful to diagnose changes in the engine after the Debian buster upgrade, described in 866685.

Bugs

Usertags

The fonts team will use these tags for usertags (user: pkg-fonts-devel@lists.alioth.debian.org)

  • non-free: for packages that contain non-free fonts taken from the web (severity serious)

  • license-violation: for packages that contain fonts that are GPL/LGPL but do not distribute source (severity serious)

  • rfn-violation: for packages that contain OFL fonts with a Reserved Font Name that have not been renamed or have lost the upstream RFN notice (severity serious)

  • ?contrib: for packages that contain free fonts that cannot be built with free tools (severity serious)

  • duplicate: for packages that contain fonts that duplicate fonts from other packages (severity normal?minor?wishlist?)

  • split: for packages that contain fonts we would like to see split into other packages (severity wishlist)
  • fontconfig: for packages that should switch to dynamically looking up font paths using fontconfig (severity wishlist)

  • render: for packages that should switch to a font renderer that automatically uses the right fonts (severity wishlist)

Font design and formats

Source Font Formats

Generating Fonts from Source

The upstream build system should always be used for generating fonts. If upstream does not have a build system, then it is a good idea to contribute one to them based on the following Free Software tools.

The fontforge is an editor for outline and bitmap fonts that generates all kinds of fonts. It is also scriptable and has an addon tool xgridfit for hinting. Fonts using these tools can be found using these commands:

apt-cache rdepends fontforge
apt-cache rdepends xgridfit

There is also birdfont and ttfautohint

Output Font Formats

ttf, otf, bdf, pfb, fnt, woff

Font Tools

Tool

Debian package

Comments

texlive-font-utils

texlive-font-utils

Programs for font conversion, testing, and other manipulation.

fttools

ttf2tex

freetype1-tools

ttf2pt1

Font converter from TrueType to Adobe Type1.

otf2bdf

otf2bdf

Command line utility that generates BDF bitmap fonts from ?OpenType fonts.

fonttools

fonttools

A Python library to open and manipulate OTF and TTF files.

GTK+ Font Manager

font-manager

Python program to show and compare fonts

GNOME Font Viewer

gnome-font-viewer

Simple interface to show a preview of all fonts installed

There are several font tools which are not included in Debian, but are used to produce fonts included in Debian:

{i}

Available in Debian although not yet in stable.

{*}

Someone is working on inclusion into Debian.

{o}

Someone requested inclusion into Debian.

{X}

Someone needs to file an RFP or ITP bugreport and update this page with resulting bug number.

/!\

Was available in Debian but is not part of stable or unstable.

Tool

Comments

{o} defcon

806513

{o} booleanOperations

806516

{o} cu2qu

868004

{o} fontmake

865283

{o} glyphsLib

868005

{o} MutatorMath

806503

{o} ufo2ft

868006

{X} mkspecimen

Font specimen generator, inspired by Wikipedia version

{X} debian2appstream

AppStream metadata generator for fonts (pregenerated fonts- entries)

Further Resources

Reference manual

Wiki pages

* tahoma

Outdated

Old, retained for historical interest and reference: