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 |
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.
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.
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.
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.
Infos
- OpenType: https://en.wikipedia.org/wiki/OpenType
- HarfBuzz: https://freedesktop.org/wiki/Software/HarfBuzz
- OpenType tags: https://en.wikipedia.org/wiki/List_of_typographic_features#OpenType_typographic_features
- FontForge: https://fontforge.github.io/en-US/
- OpenType Font Variations: https://fontbureau.typenetwork.com/news/article/opentype-font-variations-open-up-a-world-of-possibilities
- Multiple masters: https://en.wikipedia.org/wiki/Multiple_master_fonts
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
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.
News
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.