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
-
Endless OS 6 has Arrived
After more than a year since the last update, the latest release of Endless OS is now available for general usage.
-
Fedora Asahi 40 Remix Available for Macs with Apple Silicon
If you've been anticipating KDE's Plasma 6 for your Apple Silicon-powered Mac, then you're in luck.
-
Red Hat Adds New Deployment Option for Enterprise Linux Platforms
Red Hat has re-imagined enterprise Linux for an AI future with Image Mode.
-
OSJH and LPI Release 2024 Open Source Pros Job Survey Results
See what open source professionals look for in a new role.
-
Proton 9.0-1 Released to Improve Gaming with Steam
The latest release of Proton 9 adds several improvements and fixes an issue that has been problematic for Linux users.
-
So Long Neofetch and Thanks for the Info
Today is a day that every Linux user who enjoys bragging about their system(s) will mourn, as Neofetch has come to an end.
-
Ubuntu 24.04 Comes with a “Flaw"
If you're thinking you might want to upgrade from your current Ubuntu release to the latest, there's something you might want to consider before doing so.
-
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.