Main Links
Sets Draw Type Main GalleryTTF (True Type Format), is a file format created by Apple in 1980, and later Microsoft. It is widely used in websites, software, editing, and many things surrounding texts, due to the fact, that it is widely supported. macOS, Windows, and Linux, all support the usage of TTF files.
Because of its simplicity, and ease of use, TTF has gained a pretty good foothold for a long time, though its competition such as OTF (Open Type Format), and WOFF (Web Open Font Format), are gaining a pretty good lead on TTF.
Now OTF was created by Microsoft and Adobe in 1997, as a kind of superset of TTF. OTF has better support and is also just a lot better than TTF, because TTF itself, has a ton of caveats, which we will get into later.
TTF is a file format, which allows us to set vector graphics for specific characters. The reason for using vector graphics (.svg) instead of bitmaps (.png/.jpg) is simply because SVGs are scaleable to any size, while Bitmaps are not. It was created by Apple as a response to PostScript-Font by Adobe, and was very successful.
While being support by many Operating Systems to this day, it has been lacking many features such as;
- Not wide character support
- Minor difference across platforms
- Only supports Quadratic Curves (OTF supports cubic)
- Less advanced
- Larger file sizes
That however does not make it a bad font format, as it has its ups aswell.
- As mentioned widely supported
- Good for screen display
- High quality fonts
- Well documented
- Simple licensing
- Many free (of charge) fonts
The specifications, whilst being well documented, are rather complex in TTF. We will not be doing a deep dive, as this would take too long, but we highly recommend reading through The Manual that Apple provides.
Simply, the TTF format has Glyph data within the file. The mathmatical curves
we just called Quadratic Curves (or quadratic Bézier curves), are used
to create a visual representation of each character.
Following that, for these characters to get paired, we need to character map
(cmap), in which, the codes of each character (that is being used), is mapped
to its corresponding glphy.
Metrics, such as the Spacing, or Width of each character is stored seperately,
such as Kerning Tables, to Fine-Tune spacing between individal letters (such as
AV).
Probably the most interesting thing of all however is Hinting, which is a set
of table, with many many instructions that are being used to make the fonts look
even better on screen.
Finally simple Meta Data, like the Font Name, Designer, License, Copyright etc.
is stored.
Aswell as Optional Tables, for ligatures, stylistic alternates or font variations.
OTF was invented by Adobe and Microsoft. They wanted to create a better alternative to OTF. Matter a fact, OTF is also being called "The Superset of TTF". But what does it to better than TTF?
Invented in 1997, Open Type Font, uses the same basic ideas that TTF does, but in a better and more efficient way. Using ligatures such as joining letters like fi, or stylistic alternates, small caps, swashes, old figures and fractions. In comparison to TTF, OTF looks way more professional, clean and richer. The biggest upgrade in comparison though, is the fact that it can handle multiple language sets such as Arabic, Russian, Devanagari, etc.
Complex scripts can be added to change font design depending on a specific requirement. The reason why OTF is pretty popular is because it uses both TTF (TrueType) and PS (PostScript) ideas together, but does them in a better and more storage efficient way. Using both cubic and quadratic curves, allows designers to choose, and it is even a little bit more Stable Proof.
How is OTF under the hood?
Well...
The way it works is actually pretty similar to TTF. It includes a character map, where the UNICODE,
of given characters are mapped to glphys.
It also however has a GSUB Table (Glyph substitution), meaning
when you type "fi", instead of displaying "f" and "i", it replaces it with "fi", which is more efficient
and looks better. This enables advanced typography and also allows contextual shaping.
GPOS Tables (Glphy Positioning), defines how it adjust the space between the fonts. It fine tunes the space, and kerning pairs, or diacritic positing (for accents on letters), aswell as contextual positioning in scripts like Devanagari.
Font Family Name, style, designer info, and copyright data is stored, including a so called OS/2 Table, which stored Metrics, Unicode range, and Embedding permission.
OTF is a better version of TTF, though it has not really completely replaced TTF, as many people and Legacy Software is still used to using TTF.
It has the same structure of TTF, externally and internally, but it has more tables to allow for advanced typography. The extra curve features (cubic and quadratic), gives a better choice to the end-users and developers. The go-to choice for you? Choose OTF.
Hopefully this short article gave you a little bit more information about how the font files TTF/OTF work under the hood. See you in the next one!