Fonts - Old Content

From Wiki
Revision as of 16:13, 28 May 2020 by Garulfo (talk | contribs)
Jump to navigation Jump to search

< Text formatting | Symbols | Languages >

How to use fonts in ConTeXt

The ConTeXt way of handling fonts are TypeScripts. It’s a system of abstraction and aliases, which may seem “strange” at first for new users of ConTeXt.

A specific page deals with What defines the size in a font?.

Font support & configuration

Type 1 fonts

Type 1 fonts come in multiple files. The various components are:

  • .pfb: "Printer Font, Binary".
  • .pfa: "Printer Font, ASCII".
  • .pfm: "Printer Font Metrics", binary.
  • .afm: "Adobe Font Metrics".

Typically each font will have a set of outlines in a pfb or pfa file, and a set of metrics in a pfm or afm file.

Which file variations are preferred depends on platform. Linux prefers pfa and afm (the ASCII versions). Windows prefers pfb and pfm (the binary versions). Mac OS X prefers pfm and afm.

On the Mac, you may encounter old-style PostScript Type 1 fonts which have an extensionless file containing the font outlines. These are a relic from the days when bitmaps were used to display fonts on screen, and the PostScript was downloaded to the printer. Your best bet is to throw them away and get an up-to-date OpenType version, or use a font editing utility such as fontforge to convert them.

On Windows 7, the OS will identify only the .pfm file as the actual font. However, when you install the font, Windows invisibly locates the matching .pfb file from the same directory, and copies them both to the C:\Windows\Fonts directory.

True Type fonts

OpenType fonts

Basic Hints

How to change to Palatino for text with Euler for math: Palatino with Euler for Math

Some hints by Taco from the mailing list on 2005-11-20:

Q: How up to date or out of date is the information in mfonts manual?

A: It looks like it is still quite up-to-date, but some of the examples it gives may no longer be the very best and latest way of doing things, and possibly there are some new developments that do not get as much attention as desired (like texfont, and the issues arising from font map files). Overall, the document appears accurate, though.

An important thing to remember is this:

ConTeXt does not share font metric conventions with LaTeX.

(at one point it started doing so, like supporting the Karl Berry naming scheme and the PSNFSS style font family names, but that has since been abandoned).

Another important thing is that it also does not share font map files with LaTeX and, specifically,

ConTeXt does not make pdfeTeX read pdftex.map.

(this is at the root of a great many problems reported by users only familiar with PSNFSS)

The preferred format for metric files in ConTeXt is

<vendor>/<familyname>/<encoding>-<fontname>.tfm

for metrics and

<encoding>-<vendor>-<familyname>.map

for the mapping files.

  • <fontname> is usually derived from the font source (afm or ttf),
  • <encoding> is a 'controlled' list, (see Encodings and Regimes)
  • <vendor> and <familyname> are user-supplied (at install time).

There are ways to trick ConTeXt into using different conventions, but if you do that you are likely to run into trouble.

Unsorted links

Where to find fonts

Available Free Fonts

Recent experiences

2019