Not everything you can do with TrueEdit applies to GX fonts, and
not every GX effect falls into a neat grouping like glyph effects,
position effects, or language and script support. This chapter covers
the remaining tasks necessary for your GX font to identify itself and
satisfy basic system requirements.
Next is a discussion of additional editors available in TrueEdit
which are not relevant to most developers, whether or not you are
creating GX fonts, but may come in handy in an emergency.
The final section of the chapter introduces TrueEdit's hex editor,
which can be used to edit any table or to add GX effects not
supported elsewhere in TrueEdit.
Table Tag |
Contents |
---|---|
|
Glyph class |
|
Control value table |
|
Font descriptors |
|
Horizontal device metrics |
|
Font header |
|
Horizontal header |
|
Horizontal metrics |
|
Index to location |
|
Maximum profile |
|
Name |
|
OS/2 |
|
PostScript |
|
TrueEdit source tables |
This chapter also discusses the FOND
resource
required for compatibility with non-GX systems.
No matter how much time and effort you put into building a font,
no font exists alone. Most fonts are part of a larger family; all
have to co-exist with other fonts in the same script; and fonts from
all scripts must share the Font menu.
Before QuickDraw GX, font families were limited to four styles:
regular, bold, italic, and bold italic. GX provides a variety of
mechanisms to ensure that fonts and families are presented in the way
their designers intended.
Of course, the most obvious way for a font to identify itself is
through its name. Although the standard entries in the
name
table are unchanged under GX, they are now used in
a different way. These differences will be visible on the Font and
Style menus of any GX application.
Now that each family can have a distinct set of styles, it becomes
important to understand how they relate. Font descriptors let each
font identify its own style and family relations. Just as the Feature
Registry ensures that glyph effects map sensibly from one font to
another, the Descriptor Registry, ensures that
styles map sensibly from one family to another.
Two other mechanisms for font self-identification--the
OS/2
table and the FOND
resource--may
become important in particular situations.
The name
table is the chief vehicle by which you
convey information about your font to applications and end users.
Language and Script Support discussed
localizing the name
table. This section covers the use
of the name
table for font family and style
identification. GX fonts require new naming conventions, because more
style options are available and the style choices are more
flexible.
Detailed instructions for editing the name
table can be
found in Language and Script Support.
The first eight entries in the Name List window are standard
strings, required for all TrueType fonts whether they are GX fonts or
not.
Some of the standard strings are now directly visible to the end
user:
Beyond the first eight name strings, TrueEdit assigns name indices
dynamically as the font is edited. That means that one font's index
for the name of an effect may not be the same as another font's index
for the name of the same effect. Fortunately, the name indices do not
matter to the world outside the font.
What matters is the name strings themselves. When fonts that
are part of the same family support similar effects, it is very
important to use the same name (and localizations) for that effect
throughout all members of the family.
For instance, do not call an effect "Decorative Caps" in the
roman font and "Decorated Caps" in the italic font. The end
user will see these effects as closely related, even though they are
implemented as separate font files. Their names should show that they
are related.
By the same token, distinct effects should have distinct names,
whether within a single font or within a font family.
You may be tempted to add "GX" to the end of your font name, to
help end users identify your font as one that supports new effects
with QuickDraw GX. But if every font developer did that, in a few
years an application's Font menu would be full of "GX"s--and you
would be adding on another tag to go with the latest font
technology....
Apple strongly discourages changing or adding on to a font name solely to distinguish a GX version of the font.
Apple has created guidelines for an application's human interface to
GX fonts which make it easy to spot which fonts have additional GX
effects, styles, or other capabilities.
Apple is also developing ways for font developers to distinguish
their GX fonts in marketing and packaging.
The font descriptors table (fdsc
) stores information
about the relationship of a single font to other members of the same
font family.
Under GX, font families can incorporate any number of uniquely named
styles, from Antique Roman and Demi-Bold Oblique to Ultra-Wiggly.
Using TrueType GX style variations, a full range of styles can even
be built into a single font file. But what happens when an end user
selects text using these unique styles, and chooses a different font
family which has a different set of styles?
The font descriptors table (fdsc
) exists to resolve such
situations. By allowing each font to self-identify the typographic
style of its glyphs, font descriptors help the graphics
system to find the styles in the end user's new family choice which
best match the old styles.
All GX fonts should contain an fdsc
table to ensure
compatibility with applications that support font family conversions.
The fdsc
table is simply a list of
descriptors, each consisting of a four-letter tag and a
numerical value. A font may have any number of descriptors.
The four-letter convention should be familiar; it is the same one
used for resource tags and 'sfnt table tags, among many other things
on the Macintosh.
Apple has defined a standard set of descriptors to cover the most
common typographic styles; these descriptors should be present in
every font. Full definitions are included in Appendix B. Additional
descriptors can be defined by contacting the address:
fontregistry@applelink.apple.com
nalf
which is zero or undefined means the
font is alphabetic.
To add the fdsc
table:
The fdsc
table appears in the font's Tables
window.
To edit the table, double-click its entry in the Tables window. The
Font Descriptor List window appears.
The window is initially empty.
To add a descriptor:
As you add descriptors, they appear in the Font Descriptor List window, in the order you added them. The order of entries makes no difference to the operation of the font.
To edit an existing descriptor:
This is different from the usual behavior of these buttons.
fdsc
table, or click Cancel
to leave all entries unchanged.
You can't delete individual descriptors from the fdsc
table, but you can achieve many of the same results by changing the
names and values of existing descriptors. If you must delete a
descriptor, it is easy enough to delete the entire table and re-enter
it with the correct information.
As simple as editing this table is, a shortcut can make it even
simpler. Since the five standard descriptors should be present in
every font, you can create one fdsc
table with the five
standard descriptors, copy and paste it into each font you create,
and edit only the values.
The OS/2 table (OS/2
) stores information required for
TrueType compatibility with the OS/2 and Windows operating systems.
(Many additional steps may be necessary to create fonts for these
platforms.) Most of the values are used for font classification.
Apple has adopted the table for some purposes, chiefly the PANOSE
font identification system.
To add the table:
To edit the table, double-click the OS/2
entry in the
Tables window. The Edit OS/2 dialog box comes in two pages. To switch
between pages, click the Next Page/Prev Page button at the
bottom center of the dialog box.
The following sections outline the contents of the OS/2
table. For further information about the values in this table, see
the 'OS/2'
table documentation.
Page 1 of the Edit OS/2 dialog box concentrates on cross-platform
metrics information.
Among the values on Page 1 are:
Page 2 of the Edit OS/2 dialog box is mostly used to edit the
font's PANOSE classification. Full information on the PANOSE system
is available from ElseWare, Inc.
There are two ways to determine the PANOSE classification of a font:
make the measurements yourself (according to the instructions
available from ElseWare), or send a copy of the font to ElseWare and
have them measure it.
In the Edit OS/2 dialog box, the popup menus are in the same order as
the PANOSE identifiers: Family is the first identifier,
Serif Style is the second, Weight is the third, and so
on. The menus use names similar to the official ElseWare
classification names for text faces. This is convenient for text
faces, but makes setting the classification for a script or
decorative face a little awkward. You have to look up the correct
classification values, then choose the menu settings to correspond to
those values--even though the names on the menus may appear
wrong.
Other values on Page 2 include:
FOND
resourceQuickDraw GX allows each font to identify its typographic style
with a unique name and a range of descriptors. On systems without GX,
family and style name identification depend on the FOND
resource within the font file.
For backwards compatibility, all GX fonts should have the appropriate
name and style settings in the FOND
. When these fonts
are used on a non-GX system, the correct name and style (or the
closest style available) will display.
TrueEdit does not allow you to edit the FOND
resource;
use a resource editor such as Apple's ResEdit. Full information on
the FOND
resource is available in Inside
Macintosh and from Apple Developer Support.
A few additional steps are required to make the font compatible
with the systems and printers where it may be used. For the
post
and head
tables, TrueEdit provides
some essential support for both older features and features new with
GX. As the final step, you should make sure to remove all traces of
your TrueEdit work by deleting unnecessary tables from the shipping
version of the font.
The PostScript name table (post
) contains glyph names
and other information used in rendering the font on PostScript output
devices. A post
table is required in all TrueType
fonts.
The post
table is typically provided by outline-creation
tools. TrueEdit can automatically build a post
table for
a Roman font, but provides only a partial editor.
There are several formats available for the post
table:
The behavior of a format 3 font on PostScript output devices is
unspecified, except that it should not crash the printer. It may
print incorrectly, or may not print at all. In actual practice, fonts
with format 3 post
tables often print with no
trouble.
An additional format, format 2.5, is defined in The TrueType
Font Format Specification but is not supported in TrueEdit.
When you open the post
table, the PostScript Name
List window shows names for all the glyphs in the font.
You cannot add, edit, or delete post entries. This table must contain exactly one entry for each glyph in the font.
To view and edit other information stored in the post
table:
The values in the post
table are:
post
table. Although you can change this number, TrueEdit does not
necessarily make all the modifications appropriate to the new
format.
The position is the distance from the font's baseline to the center of the underline, and the thickness is the total width of the underline.
Although you cannot use TrueEdit to edit the glyph names in the
post
table, you can delete the entire table and rebuild
it. TrueEdit rebuilds the table automatically.
When you choose New Table on the Edit menu to add a post
table, TrueEdit automatically does the following.
post
table using format 2.
glyph
nnnnn
", where
nnnnn is the decimal glyph number.
The font header table (head
) stores basic functional
and typographic information for the font; some new functionality has
been defined for GX fonts. A head
table is required in
all TrueType fonts.
You cannot create a new head table in TrueEdit.
The head
table is typically automatically built and
maintained by outline-creation tools. TrueEdit provides an editor for
situations where it is inconvenient to return to the original tool,
and for the new functions which may not be supported by third-party
tools. If you know exactly what you are doing, you can edit this
information directly in TrueEdit.
Apple strongly recommends against editing most head table values in TrueEdit. Correct values in this table are essential to the proper operation of the font.
When you open the head
table, the Edit Font Header
dialog box appears.
The most significant values in the head
table are:
prop
table) to reorder.
For further information about the values in this table, see The TrueType Font Format Specification.
Before you ship your TrueType GX fonts, remember to strip the
TrueEdit source tables (TR
nn
and
clas
) and any other information not required for the
font to function. A full list of the TrueEdit source tables is
included in Appendix C.
Although these tables will not interfere with the function of the
font, they can add significantly to its size and its memory demands
on the Macintosh and on printers.
Be sure to maintain a copy of the font with all its source tables, for future editing.
Although TrueEdit is designed chiefly for adding GX functionality to a TrueType font, it has some support for a few tables which are unchanged for GX:
hmtx
Horizontal metrics
hdmx
Horizontal device metrics
hhea
Horizontal header
cvt
Control value table
loca
Index to location
maxp
Maximum profile
These tables are usually created and maintained invisibly by font
tools which edit outlines and/or instructions.
Apple strongly recommends against editing these tables in TrueEdit. None of them exists independently of other tables in the font, and you can easily create serious functional problems or corrupt font data by adding the wrong information.
TrueType uses three tables to record horizontal metrics for a font:
hmtx
for the font's ideal horizontal metrics
hdmx
for resolution-specific integer metrics
hhea
for general information needed to render a
horizontal font
The horizontal metrics table (hmtx
) records the left
side bearing and advance width of each glyph in the font, expressed
in font units. These values are called ideal metrics, because
no actual output device will be able to exactly match the values,
except under very rare circumstances. Under GX, Line Layout uses the
ideal metrics in determining position effects such as
justification.
Although TrueType instructions let you work with this information by
manipulating points on a glyph outline, it is important to remember
that those are "phantom" points. The font's metrics data exist
only in the hmtx
table. An hmtx
table is required in all TrueType fonts.
You cannot create a new hmtx table in TrueEdit.
Horizontal metrics editing is typically well supported and tightly
integrated in outline-creation tools. TrueEdit provides a simple
graphical editor for situations where it is inconvenient to return to
the outline-creation tool and rebuild the entire TrueType font. A
basic guide to the editor follows.
hmtx
table from the font's Tables
window. The Horizontal Metrics List window shows metrics values
for all the glyphs in the font.You cannot add or delete hmtx
entries. This table must contain exactly one entry for each glyph
in the font.
The ascent and descent values are taken from the font's
hhea
table.
A section at the top of the window shows the glyph number, the
current left side bearing and advance width (in font units), and
the number of outline points in the glyph.
Once you click the Next or
Prev button, any pending changes to a glyph's metrics values are
entered into the font. The Cancel button cancels changes for the
current glyph only.
hdmx
table, or click Cancel to leave
the current glyph entry unchanged.
The horizontal device metrics table (hdmx
) records
integer advance widths on a per-glyph basis for specific pixel-per-em
resolutions. These values are called device metrics, because
they are typically intended for use on a particular output device,
such as the Macintosh screen or a low-resolution printer.
QuickDraw GX does not use a font's hdmx
table, but it
may be useful to ensure backwards compatibility of a GX font on a
non-GX system.
You cannot create a new hdmx table in TrueEdit.
The hdmx
table is typically automatically built and
maintained by instructing tools. TrueEdit provides an editor for
situations where it is inconvenient to return to the instructing tool
and rebuild the entire TrueType font. A basic guide to the editor
follows.
hdmx
table from the font's Tables
window.
You cannot add or delete
point size entries in the hdmx table.
You cannot add or delete hdmx
entries. This table must contain exactly one entry for each glyph
in the font.
Once you click the Next or
Prev button, any pending changes to a glyph's width are entered
into the font. The Cancel button cancels changes for the current
glyph only.
hdmx
table, or click Cancel to leave the
current glyph entry unchanged.
The horizontal header table (hhea
) stores basic
information required by the graphics system to render a horizontal
font. An hhea
table is required in all TrueType
fonts.
For QuickDraw GX, much of the same information is provided by a
font's fmtx
table. If your font will be used on a non-GX
system, or if it does not include the fmtx
table, values
in the hhea
table may be very important.
You cannot create a new hhea table in TrueEdit.
The hhea
table is typically automatically built and
maintained by outline-creation tools. TrueEdit provides an editor for
situations where it is inconvenient to return to the original
tool.
When you open the hhea
table, the Edit Horizontal Header
dialog box appears.
The most significant values in the hhea
table are:
The difference between the ascender and descender values entered here determines the resolution of the font's glyph outline data--the number of font units that is equivalent to 1 point.
The control value table (cvt
) stores key
measurements and other values for use by a font's instructions.
You cannot create a new cvt table in TrueEdit.
The cvt
table is typically built and maintained by
instructing tools. TrueEdit provides an editor for situations where
it is inconvenient to return to the instructing tool and rebuild the
entire TrueType font.
Apple strongly recommends against editing control values in TrueEdit. Control values are typically central in determining the behavior of a font's instructions, and small changes can have dramatic effects.
A basic guide to the editor follows.
cvt
table from the font's Tables
window.You cannot add or delete
entries in the cvt table.
Once you click the Next or
Prev button, any pending changes to a control value are entered
into the font. The Cancel button cancels changes for the current
entry only.
cvt
table, or click Cancel to leave
the current entry unchanged.
TrueEdit's built-in support extends to two more tables which you will probably never need to examine, let alone edit.
The index to location table (loca
) contains the
offset and size of each glyph's outline and instruction data in the
glyf
table. A loca
table is required in all
TrueType fonts.
You cannot create or edit the loca table in TrueEdit.
The loca
table is typically automatically built and
maintained by outline-creation tools. TrueEdit lets you view the
table, but does not provide an editor.
When you open the loca
table, the Location List window
appears.
The maximum profile table (maxp
) stores basic
information used by the graphics system to determine how much memory
a font will require in operation. A maxp
table is
required in all TrueType fonts.
You cannot create a new maxp table in TrueEdit.
The maxp
table is typically automatically built and
maintained by outline-creation or instructing tools. TrueEdit
provides an editor for situations where it is inconvenient to return
to the original tool. But unless you know exactly what is wrong,
you're much more likely to do harm than good.
Apple strongly recommends against editing the maxp table in TrueEdit. Correct values in this table are essential to the proper operation of the font.
When you open the maxp
table, the Edit Maximum
Profile dialog box appears.
For information about the values in this table, see The
TrueType Font Format Specification.
The full range of capabilities permitted for GX fonts is described
in the document QuickDraw GX Font Formats. TrueEdit
gives you customized editors for many of these capabilities, but not
all.
If you need to add an effect for which TrueEdit doesn't have a
customized editor, you need to use the hex editor. With the hex
editor, you can create any table the specification allows, and thus
access the full power of GX fonts.
Here are some examples of capabilities for which you need the hex
editor--that is, for which there are no customized editors in
TrueEdit 2.0.
Customized editors for these and other capabilities may be added to
future versions of TrueEdit. Until then, using the hex editor is the
only option.
The hex editor is not for the squeamish: do not even attempt to add or modify effects using the Hex Edtior unless you really know what you're doing. Even then, make a backup first!
The optical bounds, ligature caret, and baseline tables have
variants that use a control point in a designated glyph to
specify a position of interest. Thus, for example, you can designate
a control point in some glyph as defining the y-coordinate of the
hanging baseline, or the optical edge of a particular glyph.
The built-in TrueEdit editors for these tables don't allow you to
specify control point values, only distances. To create one of these
tables in its control point format you need to use the hex editor.
The font format specification allows ligatures formed from up to eight input glyphs, but the built-in TrueEdit editor permits only three. If you have ligatures with more than three components, you need to use the hex editor.
Many of the tables in a GX font use lookup tables to find
whether a glyph index is covered by the table. These lookup tables
can use one of five different formats.
The built-in TrueEdit editors hard-wire the lookup table formats they
use, with the result that sometimes a table is much larger than it
needs to be. If space is at a premium in your font, you could use the
hex editor to create the most compact lookup table format.
The justification table can identify classes of justification
effects based on context--so that, for example, glyphs at the ends of
words justify differently than glyphs at the start or in the middle
of words. Arabic fonts which use kashidas for justification need
exactly this capability.
The built-in editor doesn't let font developers specify the required
state information, so you would have to use the hex editor.
There are four basic kinds of glyph effect, but the built-in
editors in TrueEdit do not support one of them. Rearrangement effects
can be used to move glyphs around with respect to one another. They
are needed for fonts used for South Asian scripts, such as the
Devanagari script used to render Hindi.
Because there is no built-in editor for creating rearrangement
effects, you must use the hex editor.
The font format specification includes information on how to
construct arbitrarily powerful state tables for glyph effects. For
most fonts, the built-in TrueEdit editors suffice. However, you may
be designing a font that requires effects that cannot be expressed
easily by the existing editors--for example, pseudo-random selection
of letterforms.
Using the hex editor, you can set up glyph effects to substitute
glyphs in a pseudo-random manner.
As the sfnt
format evolves, you can use the hex
editor to create tables to support newly defined capabilities.
The hex editor is flexible, but it cannot guarantee that the tables
you construct are correct. It simply inserts your entries into the
table. Thus it is very important to know what you're doing before you
use the hex editor!
If you use the hex editor to edit a table which you've previously used the built-in editors to construct or modify, you may lose the ability to use the built-in editors on that table in the future.
To open the hex editor, hold down the Option key as you
double-click an entry in the font's Tables window.
Even if you don't hold down Option, you will get the hex editor if you open a table whose tag is not recognized by TrueEdit.
The Hex Editor window shows the complete contents of the table in hexadecimal (base 16). The left-hand column shows the byte offsets from the start of the table. You can add, select, and edit the values as usual.
When you close the Hex Editor window, the Tables window updates to reflect the new size of the table.
This chapter has covered the remaining aspects of developing a GX font:
OS/2
table, and its
FOND
resource. This information determines how the
font will appear to the end user, and how it relates to other
fonts and families.
post
and head
tables, and removing
unnecessary table from the sfnt
resource.