MacDirectory Magazine

Stephen Hanson

MacDirectory magazine is the premiere creative lifestyle magazine for Apple enthusiasts featuring interviews, in-depth tech reviews, Apple news, insights, latest Apple patents, apps, market analysis, entertainment and more.

Issue link: https://digital.macdirectory.com/i/1299064

Contents of this Issue

Navigation

Page 79 of 153

Opentype Layout Decades ago, English type designer Walter Tracy said “A great typeface is not a collection of beautiful letters, but a beautiful collection of letters”. For modern digital fonts, this saying is truer than for any previous font technology. Each glyph is a little program in itself, and a font can be thought of as a program of programs. Thus, you can program your fonts to do all sorts of interesting and useful things. OpenType fonts include a formula to draw every single glyph using curves and lines. You can program these relationships manually, but fortunately, font editors can do the heavy lifting for you—at least for the most common situations. Glyph variants 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, you use a different form of a letter depending on whether it’s free-standing, at the beginning of a word, in the middle, or at the end (Figure 1). In a handwriting 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, for instance (Figure 2). How do you do this stuff? Well you could do it all by hand—sort of like typesetting in the old days, where you went to the typecase and individually selected each glyph variant one at a time. Tedious, boring, and very slow. OpenType features and lookups But OpenType has 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 them. For instance, you can add a “frac” (fractions) feature that replaces the sequence “1”,”/”,”4” with the “¼” glyph (Figure 3.). Contextual substitutions Contextual substitutions are even more powerful: for example, you can make a “calt” (Contextual Alternates) feature that automatically replaces 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 letters, for example the “A class”: AÁÂÄÀÅÃ (Figure 4). In a font editor like FontLab 7, you can design the glyph variants and write the feature code in the Features panel. Export the font, and many modern apps will automatically apply the substitutions, because the “calt” feature is typically on by default. Automatic OpenType Layout Every glyph in a font has a name. If you follow the FontLab glyph naming convention in your font, you don’t need to write any code at all to get the most common features working. For example, the ligature glyph that represents “ffi” should be named “f_f_i”. In FontLab 7, choose Font › Generate Glyphs and in the CUSTOM tab type f_f_i and click OK. Or, if you’ve already made that glyph, use Glyph › Rename Glyph and enter the name there. Then, open the Window › Panels › Features panel, click the three-lines button in the top-left and choose Add Auto Features. FontLab automatically adds the “liga” (Standard Ligatures) feature and adds the correct code. Click the play (triangle) button to compile the features, click the Text toolbar button to open a Glyph window and type “flying office”. In the top bar of the window, click the “fi” icon, turn on Features and turn on “liga”. You should see the “ffi” ligature appear in the word “office” (Figure 5). Just looking at the list of standard features in the left pane of the Features panel (Superscript, Subscript, Small Caps, Oldstyle Figures, Proportional Figures, etc.) shows how you can dramatically expand the possibilities of what you can do with a font - without writing a single line of code. For more information, visit: www.fontlab.com

Articles in this issue

Links on this page

Archives of this issue

view archives of MacDirectory Magazine - Stephen Hanson