Rutgers - The State University of New Jersey
Charles Hedrick's Typography Pages
 

Adding Apple Typography Information to an Opentype Font

Apple's native typography support in OS X is driven by a set of special tables stored in Truetype and Opentype fonts. This information includes ligatures and features such as small caps.

Opentype has similar facilities. Unfortunately Apple's code won't read the tables describing these facilities. So if you want to use a standard Opentype font with Pages and other Apple tools that understand typography, you'll need to add the appropriate tables to your OTF fonts.

Fortunately this is fairly easy. The resources you need are available at Apple's Font Tools web page.

You'll need to download the tools and documentation. However this page will include examples that should make it fairly easy to do what you want.

You'll probably want to create two files for each font: font.mif and font.jif. Font.mif contains ligatures and features such as small caps and old-style figures. Font.jif contains specifications for justification.

To apply these, you use a command like this:

ftxenhancer -l -m j.mif -j j.jif jansontextltstd-roman.otf
This says to apply the MIF from j.mif and the JIF from j.jif to the font. It changes the font in place, so you probably want to save a copy of the original somewhere.

The files I used for all 4 weights of Janson Text are given at the end. They should work for many cases, although you'll need to change the glyph indices (i.e. the numbers used to refer to specific characters in the font).

I recommend disabling the font using Fontbook and exiting from any application that might be using it before doing the update, and then reenabling it.

The features show up in the "Typography" function of the "Show Fonts" dialog. You need to click the icon that looks like a gear, at the lower left of the dialog, to bring up the Typography menu. The first couple of times I did this after changing the font, I got an odd display from the Typography menu, but it eventually stabilized. I've also seen it come up with both "unchanged" and a function checked. But again, once you check the option you want, it should work. (You may need to go back and forth the first time to make it work.)

Getting Information about the Font

The MIF file refers to glyphs either by name or glyph index in the font. However with my test Adobe OTF font I found that the Apple tools don't seem to be able to see the names, so I had to use the glyph index. The glyph index is visible if you open the file in Fontlab. (Fontlab in demo mode should work fine, as you don't need to save the font.) Otherwise, you can use the Apple tools:

ftxanalyzer -u j.list jansontextltstd-roman.otf
will produce a listing of the font which you can open in Textedit, by Unicode index.
ftxdumperfuser -u -t cmap jansontextltstd-roman.otf > j.cmap
will produce a listing that goes from Unicode name or index to glyph index. This would actually be enough, except that some of the glyphs I needed don't have Unicode names. I needed the output of ftxanalyzer to identify them. But clearly Fontlab is the easier approach.

Making up the MIF file

Here's an annotated MIF file, for Janson Text LT Std, an Adobe Opentype font. You'll probably want to look at Apple's user manual for the font tools, at the Font Tools web page, when reading this. Once you've done one, it's pretty quick to do other fonts.

// Janson Text LT STD OTF, from Adobe
// I'm using glyph indices rather than names because the Apple tools
// don't seem to be able to get at the names in this font.  That
// requires using 

// fi and fl ligatures
// You can simply copy this header
Type          LigatureList
Name          Ligatures 
Namecode      1
Setting       Common Ligatures
Settingcode   2
Default       yes
Orientation   HV
Forward       yes
Exclusive     no

// Here's the list of ligatures. 109 is the "fi" ligature.
// 71 and 74 are "f" and "i"
List
  109 71 74
  110 71 77

// OSF. In theory lower case should have setting code of 0, but that
// confuses the applications, which expect 0 to be the default
// Again, you can probably just copy this header
// Name and namecode refer to the menu entry. If there are several
//  options, such as OSF and fixed-width OSF, both have the same
//  name/namecode but different Setting and Setttingcode.
// Settingcode of 0 is the default. The software will get confused if
//  you use 0 for your option.
Type          Noncontextual
Name          Number Case
Namecode      21
Setting       Old Style Numbers
Settingcode   1
Default       no
Orientation   HV
Forward       yes
Exclusive     yes

// 17 - 26 are the digits 0-9, 234-243 are the old style figure versions
17 234
18 235
19 236
20 237
21 238
22 239
23 240
24 241
25 242
26 243

// OSF fixed width.
// This is just like the above, but uses fixed width versions of the
// OSF figures. This is a non-standard feature of Janson Text. You won't
// find it in most Adobe OTF files.
// Note that this is the case name/namecode as the previous. However
// it's setting 2 rather than 1. The menu will show "unchanged", then
// option 1, then option 2.
Type          Noncontextual
Name          Number Case
Namecode      21
Setting       Old Style Fixed Width Numbers
Settingcode   2
Default       no
Orientation   HV
Forward       yes
Exclusive     yes

17 326
18 327
19 328
20 329
21 330
22 331
23 332
24 333
25 334
26 335

// small caps. 
// Note that the fi and fl ligatures are here. I have to map the
// normal ligatures into the small caps versions. I have put ligature
// substitution first, so fi is already converted to the fi
// ligature when this is done.
Type          Noncontextual
Name          Letter Case
Namecode      3
Setting       Small Caps
Settingcode   3
Default       no
Orientation   HV
Forward       yes
Exclusive     yes

// fi and fl ligatures
109 341
110 340
// use OSF figures, since people normally expect small caps and OSF
// to go together
17 234
18 235
19 236
20 237
21 238
22 239
23 240
24 241
25 242
26 243
// lowercase letters to small caps
66 247
67 248
68 249
69 250
70 251
71 252
72 253
73 254
74 255
75 256
76 257
77 258
78 259
79 260
80 261
81 262
82 263
83 264
84 265
85 266
86 267
87 268
88 269
89 270
90 271
91 272
// ampersand to small caps ampersand
// Look carefully at your font. You may find small versions of question mark,
// slash, and various other characters
7 232

A JIF File

This part is optional. By default, Apple does justification by expanding the space both within words and between them. This is generally considered a bad idea. When you get to the point of needing to increase spacing within a word, you should probably not be doing justification.

The following JIF file changes the policy so that spacing between letters is never adjusted. It's all done by adjusting the space. If you look at the documentation you'll find that you can create all kinds of interesting policies, some of which change the letter shapes as well.

I will say that I can't get many of the features of JIF to work as documented. This example does what it claims, but policies that involve combining the two types of spacing don't seem to do quite what is documented. Furthermore, the feature that is supposed to decompose ligatures when spacing is changed doesn't seem to work.

Direction H

TablePart Factors

Whitespace 1
Interchar (all others)

Interchar 0
 BeforeGrow 0.05
 BeforeShrink -0.02
 AfterGrow 0.05
 AfterShrink -0.02
 GrowFlags intercharacterPriority
 ShrinkFlags whitespacePriority

Whitespace 0
 BeforeGrow 0.2
 BeforeShrink -0.02
 AfterGrow 0.2
 AfterShrink -0.02
 GrowFlags whitespacePriority unlimited
 ShrinkFlags whitespacePriority unlimited

Example files

Here are the files I used for Janson Text LT Std:

BACK TO TOP

For more information, contact hedrick@rutgers.edu
Last updated: Sunday, 23-Jan-2005 18:59:50 EST
© 2005 Charles Hedrick. All rights reserved.

 

Search Rutgers