® Multiple Master

®®Programs for the Macintosh Adobe Developer Support

Technical Note #5087

14 February 1992

Adobe Systems Incorporated

Adobe Developer Technologies 345 Park Avenue San Jose, CA 95110 http://partners.adobe.com/

PN LPS5087

Copyright  1992 by Adobe Systems Incorporated. All rights reserved.

No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written consent of the publisher. Any software referred to herein is furnished under license and may only be used or copied in accordance with the terms of such license.

PostScript is a registered trademark of Adobe Systems Incorporated. All instances of the name PostScript in the text are references to the PostScript language as defined by Adobe Systems Incorporated unless otherwise stated. The name PostScript also is used as a product trademark for Adobe Systems’ implementation of the PostScript language interpreter.

Any references to a “PostScript printer,” a “PostScript file,” or a “PostScript driver” refer to printers, files, and driver programs (respectively) which are written in or support the PostScript language. The sentences in this book that use “PostScript language” as an adjective phrase are so constructed to reinforce that the name refers to the standard language definition as set forth by Adobe Systems Incorporated.

PostScript, the PostScript logo, Adobe, the Adobe logo, Manager, ATM, and are trademarks of Adobe Systems Incorporated which may be registered in certain jurisdictions. Apple, LaserWriter, and Macintosh are registered trademarks of Apple Computer, Inc. Other brand or product names are the trademarks or registered trademarks of their respective holders.

This publication and the information herein is furnished AS IS, is subject to change without notice, and should not be construed as a commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies, makes no warranty of any kind (express, implied or statutory) with respect to this publication, and expressly disclaims any and all warranties of merchantability, fitness for particular purposes and noninfringement of third party rights.

Contents

Multiple Master Font Programs for the Macintosh 5 1 Introduction 5 2 Multiple Master Font Programs for the Macintosh 5 3 The BLND Resource 6 BLND Resource Header Table 6 Axis Information Table 7 Master Design Name Table 9 The Style Table 9 Primary Font Table 10 Primary Font Name table 11 4 The Macintosh FOND Resource: Style Mapping Table 12 5 Multiple Master Naming Conventions 14

Appendix A: Primary Font Axis Labels 15

Appendix B: Style Abbreviations 17

Index 19

iii

iv Contents (14 Feb 92)

Multiple Master Font Programs for the Macintosh

1 Introduction

The Adobe™ Technical Specification, “Adobe Type 1 Font Format: Multiple Master Extensions.” describes the device-independent format for multiple master font programs, which is the format used by PostScript™ printers. This document describes how to adapt those font programs for use on the Macin- tosh®. It contains information on changes in the FOND resource, the newly defined BLND resource, and information on font naming conventions. A knowledge of Macintosh font data structures is assumed. For more informa- tion on this subject refer to the following:

• Inside Macintosh, Volume 4; Addison Wesley, 1986

• Apple® LaserWriter® Reference, Addison Wesley, 1988

•“Macintosh FOND Resources,” Adobe Technical Note #0091

For information on multiple master font programs, see Adobe Technical Specification: “Multiple Master Extensions to the Adobe Type 1 Font For- mat.”

2 Multiple Master Font Programs for the Macintosh

The current Macintosh font data structure must be extended in two ways to support multiple master : there must be a BLND resource (described in section 3) for each multiple master font program, and the Style Mapping table in the FOND resource must be adapted to include new entries. The BLND resource is used by Adobe Type Manager™ (ATM™) software to access information needed to create, display, and manage multiple master typefaces in the Macintosh environment.

Multiple master typefaces are represented as Type 1 font programs. The out- line information for all master designs is represented as a single CharStrings dictionary in the multiple master font program. Each multiple master font program has one FOND resource for each master design it contains so that information, like kerning data, can be represented for each design.

5

3 The BLND Resource

The BLND resource is stored as a resource in the PostScript language font file with an ID number of 501 and a Resource Type of BLND. It consists of data that is subdivided into a BLND Resource Header table, followed by an Axis Information table, a Master Design Name table, a Style table, a Primary Font table, and a Primary Font Name table. All strings in the BLND resource are Pascal strings where the first byte is the character count and are padded to even boundaries.

Figure 1 BLND Resource Header table

Bytes

2 Version number 2 Flags 2 Number of Axes 2 Number of master designs 2 Language ID 2 Index to "Regular" Primary font 2 Number of offsets 4 Offset to 1st axis information . . 4 Offset to nth axis information 4 Offset to master FOND names 4 Offset to style table 4 Offset to list of primary 4 Offset to list of primary font names

3.1 BLND Resource Header Table

The first section of the BLND resource is the BLND Resource table, which contains the following entries:

Version Number Currently ‘2’. Flags Reserved for future use. Number of Axes The number of axes defined in the multiple master font program. Language ID Currently uses a value of 0 for fonts with English lan- guage label strings.

6 Multiple Master Font Programs for the Macintosh (14 Feb 92)

Index to “Regular” Primary font Index into the Primary Font table for the font consid- ered to be the regular, normal, or roman design for the font family. Indices start with 1. Primary fonts are those which correspond to standard styles of a fam- ily, such as light, regular, bold, and so on, and which are generally included in the font package for backward compatibility. Number of offsets Total number of offsets which follow. Offset to 1st axis information Number of bytes from beginning of resource table to Axis Information table. Offset to FOND names Number of bytes from beginning of resource table to the FOND name table. Offset to Style tableNumber of bytes from beginning of resource table to the Style table. Offset to list of primary fonts Number of bytes from beginning of resource table to the Primary Font table. Offset to list of primary font names Number of bytes from the beginning of the Primary Font Names table.

3.2 Axis Information Table

The Axis Information table follows the BLND Resource Header table and is shown in Figure 2. There is one table entry for each axis in the multiple master font program.

Figure 2 Axis Information table

Bytes 2 Flag 2 Min Range 2 Max Range Each entry: Axis Type string size Long label +1+ possible padding Short label 2 Number of pairs (to follow)

2 + 4 Design coord0 Normalized value0 2 + 4 . . .

2 + 4 Design coordn-1 Normalized valuen-1

3 The BLND Resource 7

The Axis Information table contains the following entries:

Flag If bit 0 is set to 1, axis mapping information follows the short label name. This information is required if the axis is piecewise linear as the result of non-linearity introduced by the values in the BlendDesignMap array in the font. Other bits are zero and are reserved for future use. Min Range The minimum design coordinate for the current axis. For example, if an axis has a range from 215 to 830, the value for Min Range would be 215. Max Range The maximum design coordinate for the current axis; for example, 830 for the above example. Axis Type Axis type, for example, Weight. This label should be constant for all languages, and should use one of the reserved keywords listed in the Appendix. It is intended primarily to allow applications to determine the axis type. Developers of new axis types should register new labels with Adobe Systems by contacting the Adobe Developers Association. Long Label The full name for the axis type, for example, Weight, or Optical Size. This label may be language-dependent, and is for use in user interface dialogue. Short Label Condensed axis label for use in font names. Example: wt for Weight, wd for Width, or op for Optical Size. This entry may contain leading and trailing spaces. This label may be language-dependent, and is for use in user interface dialogue. Number of Pairs Specifies the number of coordinate/value pairs which follow. Design Coordinate/Normalized Value pairs These pairs map the design coordinates of an axis to the normalized coordinates in the Blend number space. The normalized value is stored as a 16.16 fixed point num- ber. For example, in a font whose weight values range from 215 to 830, the pairs [215, 0] and [830, 1] would map the design coordinates for a minimum weight of 215 to the Blend coordinate of 0, and the maximum weight of 830 to the Blend coordinate of 1. An entry such as [215, 0] [450, .5] [830, 1] would make the mapping piecewise linear with a median blend coordinate of .5 equivalent to 450 in design space coordinates.

8 Multiple Master Font Programs for the Macintosh (14 Feb 92)

3.3 Master Design Name Table

The Master Design Name table follows the Axis Information table and con- tains the FOND name of each master design as shown in Figure 3. There is one entry for each master design in the font.

Figure 3 Master Design Name table

Bytes

Each entry: FOND name 1 (all names begin with string size . . . %M) +1+ possible padding FOND name n

FOND name list A list of the names of the FOND resources for each master design. The FOND name must begin with %M (for example, %MMyriad_215 200), so the name of a master design will not show up in the Suitcase and, hence, in the user’s Font menu.

3.4 The Style Table

Following the Master Design table is the Style table shown in Figure 4.

Figure 4 Style table

Bytes

2 Number of styles

1 Macintosh Style Code1 1 Flag Byte1 (=0 for now) 2 Axis Number 1 1st style entry 2 Number of entries1 8 1 1 (value list) 8 1 1 (optional) . . .

1 Macintosh Style Coden 1 Flag Byten

2 Axis Numbern nth style entry 2 Number of entriesn 8 n n 8 n n (optional)

3 The BLND Resource 9

The Style table contains an initial entry whose value is the number of style code entries that follow (and which may be zero). Each entry specifies the distance between points on an axis, which corresponds to the styles supported by the Macintosh. For example, if the current font were the roman style, and the user specifies bold from the keyboard or from a font style menu, the cor- responding entries in the Style table specifies the distance to move along the weight axis to get the bold style.

The Style table contains the following entries:

Number of Styles Specifies the number of styles defined for the font and hence the number of grouped entries in the table. Macintosh Style Code The value of the Macintosh Style Code. Flag Byte Should have a value of zero for now. Reserved for future use. Axis Number The number of the axis which defines the dynamic range of the style specified. For example, for a bold style, the Weight axis will be the first axis defined in an Adobe multiple master font program. Number of Entries Specifies the number of Point/Delta pairs which follow. There is a maximum of two entries. Point/Delta value list This list specifies the points on the axis at which the styles change, and the distance to move along the axis for the given style. Both values are 16.16 fixed point numbers. These do not need to be on a style boundary as they are points on a line: (200, 100), (400, 200) would add 100 to the axis at 200, 150 at 300, and 250 at 500. Also, there is a maximum of two entries.

3.5 Primary Font Table

The Primary Font table lists the design coordinates of all of the Primary fonts along with an offset from the beginning of the resource table to the FOND resource name of the font in the Primary Font table. The entry for each Pri- mary font consists of n design coordinates, where n is the number of axes, followed by an offset from the beginning of the resource to the font name for this primary font, followed by a FOND ID and NFNT ID. Figure 5 shows the format for the Primary Font table.

10 Multiple Master Font Programs for the Macintosh (14 Feb 92)

Figure 5 Primary Font table

Bytes

2 Total Number of Primary Fonts

2 (one design coordinate for each axis) 2 entry for each 4 primary font 2 2

(entries for additional primary fonts)

3.6 Primary Font Name table

The Primary Font Name table consists of a list of names of the FOND resources for each Primary font. The names are stored as prefix and postfix name strings as shown in Figure 6. Notice that the family portion of the FOND resource name in the example MyriaMM_ ends with an underscore character, which is required for multiple master fonts (see section 5).

Figure 6 Primary Font Name table

Bytes string size + 1 + possible padding example: "MyriaMM_" example: "215 LT 200 CN"

. . . .

3 The BLND Resource 11

4 The Macintosh FOND Resource: Style Mapping Table

Figure 7 shows the general form of the Style Mapping table of a FOND resource as explained in The Apple LaserWriter Reference. For a multiple master font, these tables must be located at the very end of the FOND Resource or ATM will fail. This is necessary because an additional entry must be inserted for each additional font instance that is generated.

If a large kerning table were at the end of the FOND resource, the kerning information would have to be moved each time a font is added, which would decrease performance significantly. If the font has a non-standard encoding, the encoding table must also come before the Style Mapping table. This means there will be a negative offset to the encoding table in the Style Map- ping table.

Figure 7 Macintosh FOND Style Mapping table

Bytes Style Mapping Table Style Name Table

2 Font Class String count 4 Offset to encoding table Full family name (excluding suffixes) 4 Reserved Suffix index list 1 1 Index to suffix for style code 00 Suffix index list 2 1 Index to suffix for style code 01 Suffix index list 3

1 Index to suffix for style code 47 Suffix #1 Suffix #2 Suffix #3

Last full suffix

The first entry in the Style Name table is the count of the number of strings in the table, followed by the font family name. The third entry is the index string for the companion italic multiple master font program (if there is one), and this is followed by the suffixes necessary to derive the PostScript FontName for each style (and, if required, the font file name by using the 5:3:3 rule; see “Macintosh FOND Resources”, Adobe Technical Note # 0091).

Figure 8 shows an example Style Mapping table for a derived font instance with a FOND name of MyriaMM Ita 700 BD 600 NO. The table consists of 48 indices (one for each Macintosh style code) into the Style Name table shown in Figure 9.

12 Multiple Master Font Programs for the Macintosh (14 Feb 92)

Figure 8 Macintosh FOND Style Mapping table example

Plain Bold Italic Bold ItalicOutline Outline OutlineBold OutlineItalic Bold Italic 68686868Plain 68686868Shadow 68686868Condensed 68686868Condensed Shadow 68686868Extended 68686868Extended Shadow

Figure 8 is a FOND Resource Style Mapping table example for a multiple master primary font with the FOND resource name MyriaMMIta_700 BD 600 NO.

Figure 9 shows the corresponding Font Name table, with the table containing the indexes on the left, and the names as translated from the indexes on the right.

Figure 9 Macintosh FOND Font Name table (corresponding to the Style Mapping table shown in Figure 8)

Bytes string size + 1 + possible padding example: "MyriaMM_" example: "215 LT 200 CN"

. . . .

The index list in the Style Name table (for example, at index 2) specifies the indices to the suffixes needed to build the PostScript font name for each style indicated. Also, the FOND for the Regular primary font must have plain entries without suffixes. For example, the entry for MyriadMM_500 RG 400 NO has the entries MyriadMM for plain and MyriadMM-Italic for italic.

4 The Macintosh FOND Resource: Style Mapping Table 13

5 Multiple Master Naming Conventions

The following naming convention is recommended for multiple master font programs for the Macintosh to achieve consistency in font menus.

The use of design coordinates in multiple master font names is necessary for compatibility with existing applications. As font menu software improves, it is hoped that users will not have to see the numbers and that it will be easier to navigate through multiple master font instances. Also, hopefully, applica- tions will use multiple master fonts in a manner more transparent to the user.

Font menu names for the Macintosh come from the FOND resource name. The convention for Adobe multiple master fonts is as follows:

[Style/Char Set] _Number1[Label1]...Numbern[Labeln]

where items in brackets are optional (except that the Label field must consist of at least a single non-numeric character to be used as a separator). The required elements are the family name, the underscore character (which tells ATM software where to start looking for the design coordinates), and the design coordinate number fields.

Note Although an underscore character signifies the beginning of the design coor- dinates, non-multiple master fonts can still use this character. ATM software checks for the presence of a BLND resource before assuming the font is a multiple master font program.

The design coordinates represents the values for the font’s position in design space as specified by the designer. Digits 0 through 9 are allowed, and any number of digits are allowed since the range is specified in the font. For a font with n axes, there will be n design coordinates specified in the name. The coordinate numbers must be separated by one or more non-numeric charac- ters. Text labels are recommended if space permits, otherwise, a space or underscore character should be used.

The axis Label field is required, although it might optionally consist of only a single non-numeric character to separate the design coordinates. It might consist of any number of non-numeric characters, although two are recom- mended; it can have leading, trailing, or embedded spaces. Descriptive abbre- viation labels are highly recommended for the sake of the user interface; however, if space is limited, it is recommended that the minimal single sepa- rator character be a space or underscore.

Labels for Primary fonts, which should be in all uppercase, are listed below (see Appendix A). Labels for Custom fonts (those generated by the user) should be in lowercase characters, and use the generic axis labels wt, wd, and op (if the font contains those axes). The label is strictly a comment, and is not used by the ATM software except as a separator.

14 Multiple Master Font Programs for the Macintosh (14 Feb 92) Appendix A: Primary Font Axis Labels

The following abbreviations for font styles have been adopted by Adobe Systems for use in primary font names. Custom font (font instance) names should use the generic lower case axis labels such as wt, wd, and op.

Table 1 Primary font axis labels

Weight Width Optical axis axis Size Two- Two- Two- Long Letter Long Letter Long Letter Name Name Name Name Name Name Extra Light XL Extra Condensed XC Optical Size OP Light LT Condensed CN Regular RG Semi Condensed SC Semibold SB Normal NO Bold BD Semi Extended SE Black BL Extended EX Extra Black XB Extra Extended XE

15 16 Appendix A: Primary Font Axis Labels (14 Feb 92) Appendix B: Style Abbreviations

The following style abbreviations for use in font names were originally com- piled by Apple Computer, and have since been added to by Bitstream and Adobe Systems.

17 Figure 1 Style Abbreviations

Weight Thin Th Poster Po Book Bk Light Lt Nord Nd Regular Rg Medium Md Super Su Bold Bd Demi (bold) Dm Display Ds Heavy Hv Black Blk Width Extended Ex Compact Ct Narrow Nr Condensed Cn Compressed Cm Slope Kursiv Ks Upright Up Italic It Sloped (& Sl Inclined Ic Oblique Obl Slanted) Miscellaneous (used to modify other styles) Semi Sm Extra X Ultra Ult Design and/or special purpose Roman Rm Rounded Rd Deutsche Fraktur Dfr Swash Sw Outline Ou Ornaments Or Inline In Old Style OS Small Caps SC Typewriter Typ Oldstyle Figures OsF Script Scr Titling Ti Expert Exp Shaded Sh Multiple Master MM Alternate† Alt (associated with the family portion of the name) Alternate* A Notes: † The abbreviation Alt designates a font whose character set is meant to supplement another font with identical design characteristics. * The abbreviation A typically distinguishes the second of two fonts which differ only in the design of a few characters.

18 Appendix B: Style Abbreviations (14 Feb 92) Index

M multiple master font Macintosh 5–14 Axis Information table 7–8 BLND resource 5, 6–11 Header table 6–7 FOND resource 5 Style Mapping table 12– 13 Style Name table 12–13 Master Design Name table 9 naming conventions 14 Primary Font Name table 11 Primary Font table 10 Style Mapping table 12 Style Name table 12 Style table 9–10

P primary font axis labels 15

S style abbreviations 17

19 20 Index (14 Feb 92)