Metric-compatible fonts

From ArchWiki
Revision as of 18:36, 28 August 2017 by Arthur2e5 (talk | contribs) (Point to EB Garamond for those optical size fans)
Jump to: navigation, search

Metric-compatible fonts are fonts that match the metrics (i.e. glyph dimensions) of another font (often generics such as Helvetica, Times or Courier). Due to their matching metrics, replacing a font with a metric-compatible alternative does not change the formatting of the document or a web page. Such fonts are often developed for FOSS systems to display pages correctly.

List of metric-compatible fonts

In the following table, commonly-specified families are shown in bold. This table is roughly based on fontconfig's 30-metric-aliases.conf and Wikipedia pages for individual fonts.

"Core fonts for the web" compatibilities
PostScript URW GUST GNU Windows Microsoft Liberation CrOS StarOffice
Helvetica Nimbus Sans, A030 TeX Gyre Heros FreeSans MS Sans Serif (Helv) Arial Liberation Sans Arimo Albany
Times Nimbus Roman TeX Gyre Termes FreeSerif MS Serif (Tms Rmn) Times New Roman Liberation Serif Tinos Thorndale
Courier Nimbus Mono TeX Gyre Cursor FreeMono Courier New Liberation Mono Cousine Cumberland
Helvetica Condensed Nimbus Sans Narrow TeX Gyre Heros Cn Arial Narrow Liberation Sans Narrow
Georgia Gelasio
Microsoft Office fonts
Microsoft CrOS
Cambria Caladea
Calibri Carlito
Symbol SymbolNeu
Microsoft UI fonts
Microsoft FOSS
Segoe UI Selawik
Tahoma Wine Tahoma
Other PostScript core families
PostScript URW GUST Windows
ITC Avant Garde Gothic URW Gothic TeX Gyre Adventor Century Gothic
ITC Bookman Bookman URW TeX Gyre Bonum Bookman Old Style
ITC Zapf Chancery Chancery URW, Z003 TeX Gyre Chorus Monotype Corsiva
Palatino Palladio URW, P052 TeX Gyre Pagella Palatino Linotype, Book Antiqua
New Century Schoolbook Century SchoolBook URW, C059 TeX Gyre Schola Century Schoolbook
PostScript 3 Fonts
PostScript URW
Optima URW Classico
Antique Olive Antique Olive
Univers U001
Clarendon Bold Condensed Clarendon URW Bold Condensed
Coronet Coronet
Letter Gothic Letter Gothic
Marigold Mauritius
Albertus A028
Garamond Garamond No. 8

Generic Families

PostScript

The PostScript language defines 35 core fonts in PostScript 2. URW released open-source versions of these 35 fonts for w:ghostscript. Projects including GUST's TeX Gyre and GNU FreeFont release enhanced versions of these fonts.

PostScript 3 defines an additional 101 fonts, many of which are made available by URW in GhostPDL.

Garamond

URW's Garamond No.8 only provides one optical size. You may use EB Garamond for more OpenType features.

Microsoft

Microsoft bundles a number of fonts with Microsoft Windows and Microsoft Office. While some of these fonts are just a cheaper version (or look-alike) of corresponding PostScript families, Cambria and Calibri (default font since MS Office 2007) are independent from other families. Microsoft used to provide many core fonts in its Core fonts for the Web project. Although this project is later unavailable on Microsoft's site, the license terms that allow these fonts to be distributed from third-party sites make packages like ttf-ms-fontsAUR possible. See also Microsoft fonts.

Metric-compatible font projects

TeX Gyre

TeX Gyre is a remake and extension of 35 base PostScript fonts distributed with Ghostscript ver. 4.00. The project provides TeX support and also the cross-platform OpenType format of the fonts.

GNU FreeFont

GNU FreeFont is an outline family intended to cover as much of the UCS charset as possible. Most of the Latin characters are from URW fonts. This set of fonts is released under GPL v3+ + FE.

Liberation

Wikipedia:Liberation fonts provides four families Liberation Sans, Liberation Serif, and Liberation Mono, intended to be metric-compatible with common Microsoft Windows fonts. Since version 2.0.0, this set of fonts is released under SIL OFL, and is based on #Chrome OS core fonts. They are available as ttf-liberation.

Older, GPL-licensed versions of this font is based on Ascender Corporation's fonts, which is licensed by Red Hat, Inc. These versions of Liberation also includes Liberation Sans Narrow, which corresponds to Arial Narrow.

Google

Google provides a high number of fonts, including different metric-compatible font families.

Chrome OS

Google ships open-source metric-compatible fonts with its operating system, Chrome OS, under the Apache License 2.0. CrOS core (croscore, ttf-croscore) is a collection of Arimo (sans), Tinos (serif) and Cousine (mono), also licensed from Ascender Corporation. A set of extra fonts, CrOS extra (crosextra) provides Carlito (ttf-carlitoAUR) and Caladea (ttf-caladeaAUR) to match default fonts for Microsoft Word.

Since glyph mappings from Symbol are usually implemented in browsers, Google no longer ships SymbolNeu in croscore > 1.23.0. You can get this font from croscorefonts-1.23.0.tar.gz.

Noto

Google's Noto Fonts are available via noto-fonts. They are licensed under SIL OFL. Noto Fonts are designed to supplement glyph coverage for Roboto, the standard typeface for Android, and are vertically (i.e. same line height for the same font size) metric-compatible with Roboto.

Other metric-compatible fonts

Selawik

Selawik is an open source replacement for Microsoft's Segoe UI by Microsoft.

Wine Tahoma

The Wine project developed a metric-compatible font to replace Microsoft's Tahoma, available as ttf-tahomaAUR. Its name in TTF data is simply "Tahoma", so there is no configuration needed.

Example configuration

For font consistency, all applications should be set to use the serif, sans-serif, and monospace aliases, which are mapped to particular fonts by fontconfig. Font configuration#Replace or set default fonts explains two ways to achieve the configuration, both are covered with an example for metric-compatible fonts below.

Example for binding method

The following example configuration uses the #Liberation fonts.

/etc/fonts/local.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <match target="pattern">
        <test qual="any" name="family"><string>serif</string></test>
        <edit name="family" mode="assign" binding="same"><string>Liberation Serif</string></edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family"><string>sans-serif</string></test>
        <edit name="family" mode="assign" binding="same"><string>Liberation Sans</string></edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family"><string>monospace</string></test>
        <edit name="family" mode="assign" binding="same"><string>Liberation Mono</string></edit>
    </match>
</fontconfig>

Example for prefer method

The following example configuration uses the #Chrome OS fonts, adding additional aliases for other fonts frequently required to refer.

/etc/fonts/local.conf
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 
  <!-- Prefer fonts for generics -->
  <alias>
    <family>serif</family>
    <prefer><family>Tinos</family></prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer><family>Arimo</family></prefer>
  </alias>
  <alias>
    <family>sans</family>
    <prefer><family>Arimo</family></prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer><family>Cousine</family></prefer>
  </alias>
   
  <!-- Map specific families to CrOS ones -->
  <match>
    <test name="family"><string>Arial</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Arimo</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Helvetica</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Arimo</string>
    </edit>
  </match>
  <match> <!-- NOT metric-compatible! -->
    <test name="family"><string>Verdana</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Arimo</string>
    </edit>
  </match>
  <match> <!-- NOT metric-compatible! -->
    <test name="family"><string>Tahoma</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Arimo</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Times New Roman</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Tinos</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Times</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Tinos</string>
    </edit>
  </match>
  <match> <!-- NOT metric-compatible! -->
    <test name="family"><string>Consolas</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Cousine</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Courier New</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Cousine</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Calibri</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Carlito</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Cambria</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Caladea</string>
    </edit>
  </match> 
</fontconfig>

See also