2
votes

I've been reading through the specification for SVG fonts and I stumbled across this tidbit:

glyph-name = "< name > [, < name > ]* "

A name for the glyph. It is recommended that glyph names be unique within a font. The glyph names can be used in situations where Unicode character numbers do not provide sufficient information to access the correct glyph, such as when there are multiple glyphs per Unicode character. The glyph names can be referenced in kerning definitions.

Emphasis mine. This seems to suggest my understanding of what fonts are is wrong. I'd always understood them as the one to one mappings of unicode code point (computer representation of a character) to glyph (the visual representation of a character). It leaves me with several questions.

  • How do font rendering engines choose which glyph to display for code points with multiple glyphs?
  • How is that character then stored in strings? How is the extra information dictating which of the multiple glyphs to be used attached to the unicode code point?
  • Has anyone ever seen a real world example of a font that has multiple glyphs for a single unicode code point?
1
The typical example are accented character like ü which are rendered as a composite glyph referencing the u and ¨ glyph.nwellnhof

1 Answers

1
votes

The magic word you're looking for is ligatures.

Some fonts contain special glyphs which are used to replace a specific sequence of characters, often to use an alternate form of one or more letters for better layout. These are most common in script fonts, and in fonts for certain languages (like Arabic).

An example of such a font is Zapfino. The image below contains five glyphs: the first four are each for one pair of characters, and the last is for a seven-letter sequence.

Zapfino ligatures

These ligatures exist purely in the font rendering engine. The string being presented above is simply:

st  ff  fi  fl
Zapfino

with no presentation modifiers.


Zapfino also makes an excellent example of a second point: Fonts can contain multiple glyphs for the exact same character. Here, for instance, are all of its glyphs for the character A:

enter image description here

These stylistic variants do not have any presence in the input text either. They must be selected by other methods, such as the font-variant-alternates CSS property in HTML. By default, most rendering engines will not use any stylistic variants unless specifically directed to do so.