OpenType and HarfBuzz

Letter Tags

Even the best-designed font usually has glyphs that do not fit side by side. Often, they involve combinations starting with "f" such ff or fi. To improve legibility, professional typesetting replaces these combinations with ligatures, a single glyph that represents both of these letters, but is better designed (Figure 5). Until now, users have had to pick ligatures out of a special character dialog, which is enough of a distraction that many users never bother. With OpenType and HarfBuzz, ligatures can be added automatically (Table 3).

Table 3

Letter Tags

liga

Replaces awkward letter combinations with a redesigned single character

subs

Replaces characters with subscript glyphs

sup

Replaces characters with superscript glyphs

title

Replaces characters with glyphs suitable for large type, such as titles

Figure 5: Ligatures are single glyphs that replace awkward combinations of two or more glyphs.

Similarly, word processors and layout applications have long had the ability to write subscript and superscript characters. However, as with small capitals, their position has often been set by the application. With OpenType, font designers can now specify a position for subscript and superscript (Table 3).

Of course, not every tag is available in all OpenType fonts. Some designers may prefer that their fonts not have certain features, and some probably will not add certain tags until their fonts support the scripts that use them. Yet, even with these limitations, OpenType and HarfBuzz make uniformity across applications greater than ever was possible in the past. No longer do users have to depend on an application to implement features; they can be enabled within the font itself.

Applying OpenType Tags

In an OpenType font, tags are set in a series of layout tables. In free software, these tables can be accessed from within FontForge [4] (Figure 6). FontForge fully supports OpenType, so to enable a tag, designers only need to design all the glyphs and then right-click on each glyph separately and select the tag from the drop-down list. So long as the font is free-licensed, the designer or any other user can enable or disable tags at will – although backups of the OpenType file should be made first in case a mistake is made.

Figure 6: OpenType tags are stored in tables in the font file.

Users can also apply tags in specific applications. In any application that uses HarfBuzz, tags can be added in any field for font selection. Each tag must be preceded by a hyphen, and tags can be chained together, with no spaces between them and the font name or each other. For example, in Figure 7, the Fanwood font is selected in the paragraph style dialog, and tags are added to use small capitals and old style figures.

Figure 7: Tags can be added in a field for font selection, so long as the application uses HarfBuzz.

In LibreOffice, tags can be added to paragraph styles, or with even more flexibility, to character styles, where they can be applied only when needed. For convenience, you can add tags to a template – including your default – so that they don't have to be added to each new document.

New Controls

The combination of the OpenType format and the HarfBuzz "text shaping library" gives users unprecedented control over fonts. If anything, some designers may be uncomfortable with how much control users now have over their creations. However, in effect, users can now modify fonts in the same way they can modify source code, although fonts are even more accessible than code.

Moreover, the availability of tags is only the beginning. Currently, OpenType Font Variations [5] are being developed as a modern version of Adobe's multiple master fonts [6]. With OpenType Font Variations, different weights of a font can be selected as easily as dragging a slider bar. Since making a glyph thinner or thicker without distorting it often requires design changes, an OpenType Font Variation can include nearly 100 changes (Figure 8). As I write, OpenType Font Variations are still in development, and whether a weight will be selectable through tags is apparently still uncertain. Yet, one way or the other, the new technology promises to give users even more control over their fonts.

Figure 8: Font variations promise to make different weights easier to select, even allowing for changes in design as the weight changes.

Clearly, free fonts have come a long way since their first appearance in the early years of the millennium. At the time, many people questioned whether designers would ever be interested in designing free fonts. Many even wondered if fonts, as artistic works, should be an exception to free software. Yet today, not only are hundreds of free fonts available, but, thanks to OpenType and HarfBuzz, fonts are now as hackable as any other part of the Linux stack.

The Author

Bruce Byfield is a computer journalist and a freelance writer and editor specializing in free and open source software. In addition to his writing projects, he also teaches live and e-learning courses. In his spare time, Bruce writes about Northwest Coast art. You can read more of his work at http://brucebyfield.wordpress.com

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News