Skip to content

FontLab in 8 days — Day 4: Clever fonts

Make your fonts dance and sing with FontLab’s powerful OpenType features! FontLab 8 makes it easy to add automatic ligatures, stylistic alternates, swashes, contextual substitution and more. Simple glyph naming conventions can enable complex font behaviors. Take your fonts beyond basic letters and unlock their full potential! Empower your font’s users with rich typographic options that adapt to different situations. Use FontLab 8’s auto features to quickly implement advanced OpenType functionality in your fonts.

Lovely ligatures: Connecting letters in FontLab 8

You’ve seen those fancy joined letters — usually pairs like “fi” and “fl”, sometimes three or more connected in a row. These are ligatures.

Foundries that cast fonts in metal produced ligatures for letter pairs that didn’t fit well together: a single combined piece of type worked better than fiddling with two incompatible slugs. Ligatures also add visual interest and distinctiveness to a font, so they’ve carried over into the digital era.

If you create the individual letter glyphs, and the ligature glyph, your OpenType font can take the role of a skilled typesetter: with a little piece of code inside the font, the ligature appears whenever the user types the constituent letters. How? The font must contain a Standard Ligatures feature that says: when an “f” is followed by an “i”, replace those two glyphs with the “fi” ligature glyph. Whenever an OpenType-savvy app sees a letter sequence that matches a substitution rule, it performs the glyph swap.

It’s easy to create this Standard Ligatures feature in FontLab. If you have the glyphs “f” and “i”, draw a new glyph that has the “fi” design. In the Glyph panel, name the glyph “f_i”: the underscore specifies it as a ligature. In the Features panel’s local menu (☰) choose Add Auto Features. FontLab creates the feature named “liga” with the necessary code. If you add more ligature glyphs with the correct names, just click the star button in the Features panel to update the code.

FontLab will put glyphs with the name suffix “.liga” (like “V_A.liga”) into the Standard Ligatures feature (“liga”), which is on by default in apps, and those with the suffix “.dlig” (like “s_t.dlig”) into the Discretionary Ligatures feature (“dlig”), which if off by default but can be manually enabled in apps that have an OpenType menu. Names like “a_b” (without the suffix) go into “dlig”, except for a small set of common “f_” ligatures.

Ligatures are a great way to add spice to a text font. Thanks to FontLab’s auto features, you can easily build ligatures of your own from existing letter parts to make a unique design.

OpenType features: Empowering your font in FontLab 8

Decades ago, English typeface designer Walter Tracy wrote “A great typeface is not a collection of beautiful letters, but a beautiful collection of letters”. For digital fonts, this is truer than ever. Every glyph is like a little program, and a font is a coordinated system of programs. You can make your fonts dance and sing by including clever features that automatically trigger special behaviors in response to the text content or environment.

In a font, each glyph is defined as a series of mathematical outlines formed by Bézier curves and straight lines. Modern OpenType fonts go beyond this to provide two kinds of smartness: continuous variation along axes like weight and width, and complex substitution and positioning of glyphs to handle different linguistic, typographic and aesthetic situations. We’ll look at this second capability, known as OpenType Layout.

In English, words are ordinarily written in lowercase letters, but you use Uppercase to start a sentence or a Proper Noun. Other alphabets require more smarts. In Arabic, a letter has different shapes for use at the beginning, middle, or end of a word, or when free-standing. Some letters flow together in a semi-connected cursive.

In a handwriting or calligraphic font, you don’t want all the “e”s to be identical. That would look unnatural. But sometimes you want “unnatural”, like a swash cap. We’ve seen that in OpenType, you can define automatic ligatures — But it can go way beyond that, replacing any sequence of glyphs with a special variant, based on adjacent glyphs and other contextual factors.

OpenType has a concept of “features”: a predefined catalog of methods that give a font user access to an extended glyph repertoire; and of “lookups”: small programming functions that can perform substitutions (swap one glyph form with another, replace several letters with one to form a ligature) or positioning (move glyphs closer or further apart, or up and down).

The user selects some text in an OpenType-aware app, and applies some features to it, for example: “turn on ligatures and fractions”. If the font supports any of the requested features, the app runs the lookups associated with these features. When you’re making a font, you can add a “frac” (fractions) feature that replaces the sequence “¼″ with the “¼” glyph.

Every glyph in a font has a name. Follow the FontLab glyph naming convention in your font, and you won’t need to write any code at all to get the most common features working. For example, the swash variant of “A” should be named “A.swsh”. Choose Font > Generate Glyphs and in the Custom tab type “A.swsh” and click OK. Or, if you’ve already made that glyph, use Glyph > Rename Glyph and enter the name there. To make a variant that works when the user requests “ss01” (Stylistic Set 1), name the glyph “A.ss01”. For small caps, use “A.sc”. You get the idea. If you have glyphs named this way, just choose Add Auto Features from Features panel’s ☰ menu — that’s it!

Contextual substitutions are even more powerful: for example, you can make a “calt” (Contextual Alternates) feature that automatically replaces the the “W class” (that is, the letter W and its variants with diacritics like ẂŴẄẀ) with decorative (swash) variants, but only if these letters are between some other. For contextual features, you’ll need to write the feature code in the Features panel, but there are many tutorials that will help.

Read more

Video tutorials