BackNextContents


Working with the mort Table


Caveats

TrueEdit automatically manages many of the details of adding and editing glyph effects, but at the price of some flexibility.

Interdependencies

Three tables are involved in determining a font's glyph effects: 'mort', 'feat', and 'name'.

The feat table defines each feature, such as "letter case" and whether it's a radio or a checkbox. The mort table defines the individual feature settings, such as "upper & lower case" or "small caps".

To GX, mort is the master table. feat just defines the interface and maps to the name table.

In addition to these, TrueEdit also inserts temporary tables into fonts it edits. All of these tables are called "TRnn ", and none are required by the end-user of a font. The TRnn tables hold the information displayed in the feature editor windows. TrueEdit uses this information to edit and generate the mort subtables in a font because it cannot decipher the mort information.

This isn't a flaw in TrueEdit: some of the effects possible in GX fonts just cannot be "reverse-engineered" back to an editable form: given an particular effect, it is impossible to determine how that effect was defined. Because the TRnn tables contain no extra information, if you remove them from a font, the font can still be used by GX - such a font is known as a stripped font. However, if you try to edit such a stripped font using TrueEdit, you will not be able to edit certain parts of the font file, since the information which TrueEdit needs to show its editor windows has been removed.

Appendix C lists the TrueEdit tables and the information contained in them.

TrueEdit takes care of feat (organization, defaults, etc.) and most of name (adding new name strings using the latest names from the registry) for you.

TrueEdit also maintains entries in the name table which describe the features and settings you add to your font. Although the name strings themselves appear in the name table, they are indexed in the feat table; thus, it is very important that the mort, feat, and name tables remain together in the font where they were built.

TrueEdit automatically adds empty settings where appropriate

Assumptions

TrueEdit makes some assumptions about how the mort table is laid out. If these assumptions are not valid for a particular font, then TrueEdit will not be able to open the mort table properly.

TrueEdit does not check the layout of the mort table first; it just goes ahead and tries to open it, and typically hangs or bombs if the layout of the table is not as expected.

If a font meets these assumptions then, even without 'TRnn' tables, you can open the mort list window, reorder features, and set defaults.

In particular for people who want to do wild stuff, this means you may have to forego the option of using TrueEdit's nice editors in the future.

These assumptions are described in detail in Appendix C.

Limitations


One assumption results in an important limitation of TrueEdit:

[!]A mort table built with TrueEdit can define at most 32 glyph effects.

This total of 32 glyph effects does not include empty settings. There are also a few other caveats concerning glyph-effect editing in TrueEdit - these are set out in Appendix C.

A few QuickDraw GX features are not supported by TrueEdit 1.0; notice is given in the discussion of that effect. Even if a GX feature is not directly supported by TrueEdit, the table defining that feature may still be edited using the Hex Editor.

[!]TrueEdit has difficulty with some aspects of right-to-left fonts, such as Arabic and Hebrew. Some aspects of the tool are confusing or awkward to use with such fonts, while others may not operate properly.

This is not to say that these things are impossible, but you should at least understand that this is a task for an engineer, working together with a font designer, rather than for the casual user.

Creating the mort table

To create a new glyph metamorphosis table:

  1. Choose New from the Edit menu
  2. Choose "metamorphosis" from the popup and click OK.



TrueEdit automatically adds a feat table (in addition to the mort you asked for).

Adding effects

To add an effect:

  1. Double click the mort table, or use the command Open Table from the File menu.

  2. This opens the Metamorphosis Subtables window.
  3. This window will be empty except for two column headings: Feature and Setting.
  4. Choose Add Entry from the Edit menu, or press Command-A.

  5. A dialogue box will appear, featuring two popups, labeled Feature and Setting.
  6. Use the Feature popup to see all of the possible pre-defined features supported by TrueEdit.
  7. In this example, choose Letter Case.


  8. Use the Settings popup to see each setting available for the feature you have chosen.

  9. Every Feature will have its own selection of relevant settings.
    For example, "Small Caps" is one of the settings of "Letter Case".
  10. Click OK.

  11. The subtable necessary to implement the Feature and Setting is added to the list of mort subtables.


  12. If you open the name table, you can see that TrueEdit has automatically added the name entries necessary for this feature and setting (the last two in this picture).

[Sticky!]

(The "All Typographic Features" is a general feature which acts as a master switch for all glyph effects in the font. TrueEdit adds it automatically when you add the first glyph effect to the mort table.)

Editing effects

Editing effects uses the basic operations involving the glyph palette, discussed in Introduction to TrueEdit.

To open the subtable editing window, double-click a setting in the Metamorphosis Subtables window, or choose Edit Entry from the Edit menu.

Each effect editor window looks different, depending on the setting. All the mort table effect editing windows scroll and resize, and use the Glyph Palette.

Note that the editors show the glyph numbers in their own windows, and the Size menu applies, just as for the glyph palette. You can also resize most of the windows.

Examples


Following are four examples of editing glyph effects in TrueEdit. Note that:

There is no example of a rearrangement effect, because the only registered effect which demonstrates rearrangement isn't implemented in TrueEdit!

Small Caps

Small captitals is a common typographic effect in which the "lower case" letters in a piece of text are replaced with small versions of the capital letters. The illustruation below shows this effect:

To add small capitals to a font, the font must have a set of "small capital" glyphs in its glyph-table. Using the "Small Caps" feature editor, you can then tell GX which it small capital glyphs it should substitute for the normal lowercase glyphs when the "Small Caps" feature is enabled.

To create the small capitals feature, follow these steps:

  1. Open the window for editing, edit the setting "Small Caps".
  2. This is a standard non-contextual editor, allowing one-for-one glyph substitution. Other non-contextual effects in TrueEdit use similar editors.
    While TrueEdit will allow you to use the "Small Caps" feature editor to describe other one-to-one substution effects, you should never call anything which does not involve replacing lowercase letters with small capitals "Small Caps": instead, you should consult the documentation for "Character Alternatives", "Design Levels" or "Ornament Sets".



  3. Open the glyph palette and scroll until you can see the input glyphs (the lowercase letters):


  4. Select these...


  5. ...drag them to the live area of the editor...


  6. Note that the drag shows a square for every glyph in the selection, including the ones off screen. You may think this is just a curiosity, but it is handy in keeping track of large selections and feeling reassured that everything made it.

  7. ...drop, and the glyphs appear in the subtable window.


  8. Scroll to the top.


  9. Now scroll the glyph palette again; select and drag in the appropriate output glyphs (the small captial letter glyphs).


    Note the convenience features: dragging lots at a time, the fact that the editor recognizes that you're trying to put 26 glyphs into the output column and thus only lets you drop them into a live area which can handle 26 glyphs

    Also note that it doesn't matter at all which glyph you drag from; the first glyph in the selection goes into the first spot, etc, but you have to drop the selection on the first glyph's live area.

  10. Drop, and the window shows the results


  11. To add new inputs, select and drag them into the live area at the bottom left.



  12. To change an input or an output glyph, drag a replacement over it (this only works for single glyphs).



  13. To delete glyphs from the effect entirely, select the row and choose Clear or press the delete key.

Common Ligatures

Ligatures are glyphs which represent two or more letters. Ligatures are used in place of common letter combinations which would not kern very well if left separate. In English-language typography, the most frequently-occurring ligatures are those shown below:


... although that is probably the first and last time those particular words will find themselves together in the same sentence!

To set up the common ligatures for a font, follow these steps:

  1. Add the effect by choosing Ligatures from the Feature popup and Common Ligatures from the Setting popup
  2. Then open the editor... you see four columns this time,

  3. This is a standard ligature editor, allowing one-for-many glyph substitution. Other ligature effects (including some that don't result in typographic ligatures) in TrueEdit use similar editors.


    The three leftmost columns in this editor are used to specify which combinations of letters can form ligatures. The "Glyph1", "Glyph2" and "Glyph3" columns contain a sequence of character glyphs. When this sequence of glyphs occurs in a line of text, a ligature is substituted for the sequence (assuming of course that the "Common Ligatures" effect is enabled). The rightmost column of the editor ("Ligature") contains this ligature glyph.

      Although GX allows up to eight glyphs to form a ligature, TrueEdit only allows you to specify sequences of one, two or three glyphs to form ligatures.

    Unlike in other editors in TrueEdit, all of the columns of this editor are live and you can add glyphs to this table in any order. Thus you can easily add all the ligatures first, then the glpyhs which construct them. Also unlike elsewhere in TrueEdit, you can drag multiple glyphs to the output ("Ligature") column.

  4. To begin, select all the ligature glyphs from the Glyph palette and drag them into the "Ligature" live area.



  5. Now you can drag all the component glyphs into the inputs on the left in any order

Other than this, adding Common Ligatures is pretty much the same as Small Capitals.

Diagonal Fractions

The "Diagonal Fractions" effect replaces numeric characters to the left of a fraction bar with their superior form, and those to the right of a fraction bar with their inferior form, as shown in the diagram below.

Note that this is a contextual effect: whether or not a number is converted to a superior or inferior depends on whether it is to the left or right of the fraction bar.

The fraction bar is a special type of slash character which is only used to produce diagonal fractions. The fraction bar is not the same as a forward slash: in the diagram above, the date ("19/05/96") has not been converted into a fraction because normal slashes were used between the numbers. The fraction bar tends to move around on keyboard layouts, but on US keyboards it can be typed as Shift-Option-1 (one).

[Sticky!]

The big difference when defining this effect is that all combinations of the inputs and outputs are not expressly shown, but by following the directions below, you should get the appropriate results.

  1. Add the effect by choosing Fractions from the Feature popup and Diagonal Fractions from the Setting popup


  2. The Diagonal Fractions editor appears. This is a contextual editor, allowing context-dependent glyph substitution.
  3. The top of the window contains a list of valid separators for diagonal fractions. The only reasonable separator is the fraction bar, so drag it into the live area at the top. You may be tempted to use the forward slash as an alternative separrator, but this would cause dates or other slash-separated numbers to be converted into fractions when the effect is applied.
  4. Now that you've used the top half of the window, you don't need it, so you can adjust the split using an invisible feature. Click on the top edge of the split bar (window divider) and drag it up or down to the new position:


  5. Now you've got more room to add the rest of the fraction information. To do this, drag the basic forms of the numbers (remember to take both upper and lower case digits if present in a font) into the "Digits" column; their matching superior forms into the "Numerators" column (don't worry if there's only one case of superiors - you can use the same superiors for both upper and lower case digits); and the inferiors into the "Denominators" column. When you're finished, the table should look like:

Prevent Overlap

Overlap is an undesirable effect that can sometimes occur when using swash characters. The descenders or ascenders of letters after an initial swash character can collide with the swash, as shown in the example below.

In the first line of text, the y in "Lyon" and the first j in "Ljubljana" have collided with the long swashes on the initial Ls.

The second line shows a more aesthetically pleasing version of the line: the swashed Ls have been replaced with their normal forms. Note that this is a contextual substitution: the Ls were only reverted to their normal forms because they were followed by a collider glyph (a character form which would cross or touch the swash on the Ls) - any swashed L's which are not followed by a collider glyph will remain swashed even when "Prevent Overlap" is enabled.

The Prevent Overlap feature editor works on two levels. Firstly, a set of substitutions is created, each associating a swashed character glyph with its normal, non-swash form. Secondly, a set of trigger conditions must be defined to tell GX when to substitute the swash form with the normal glyph. For example, the substitution illustrated above is "Substitute normal-L for swash-L", and two of the trigger conditions are: "swash-L followed immediately by 'y'", "swash-L followed immediately by 'j'".

To make an Overlap Prevention table, follow these steps:

  1. Add the effect by choosing Overlapping Characters from the Feature popup and Prevernt from the Setting popup menu.
  2. Open the effect to edit it and see...
  3. Then open the editor...

  4. This is another unique contextual editor.
  5. The editor consists of two sets of lists. The upper list is a list of substitutions. For each entry in this upper list, the "Swash" glyph will be substituted with the "Normal Form" glyph. The conditions under which this substitution occurs are defined in the lower list.

    This lower list contains a set of glyphs which can collide with the "Swash" glyph, and a spacing threshold ("Threshold") for each of these colliders. This threshold value indicates how close a specific collider glyph can get to the swash glyph before the swash glyph should revert to its normal form.

    Initially, the "Swash" column is the only live area. When a swash glyph has been dropped into this column or an existing swash glyph is selected, the "Normal Form" and "Collider" areas also become live.
    [!]You can't use classes in this editor - each affected glyph must have its own entry in the table.

  6. Not only can the editor window be resized, but the split bar (the bar with the "Collider" and "Threshold" headings in it) can also be dragged up or down. We'll just resize the window for now, then drag in the problematic overlapping glyph.
  7. Now drag the corresponding non-overlapping form of that glyph into the "Normal Form" box . The "Normal Form" is what that glyph should revert to when a collision occurs: in this case, it's the ordinary "L" glyph.
      [!]You can only revert the left-hand glyph of a colliding pair of glyphs (within a line). Setting a checkbox in the Get Info dialog will let you revert the right hand glyph instead, but TrueEdit does not allow you to have reversion of both left-hand and right-hand glyphs in the one font (although GX does).
      [Sticky!]



    Now it's time to describe which situations should trigger this substitution:

  8. First, select the row containing the swash form you want to edit:


    Note that each glyph substitution has its own set of triggers: when you select a particuar substitution, its set of triggers will appear in the bottom half of the window.

  9. Drag the glyphs which should trigger this substitution into the "Collider" live-area, on the lower-left of the Prevent Overlap editor window.


  10. Finally, set the threshold for each of the collider glyphs. The threshold is in character position units: a "Threshold" value of 1 means that a collision will occur (and thus, that the swash should be reverted) when that collider is within one character position of the swash -- that is, when the collider is next to the swash character. For most collisions, a Threshold of 1 is adequate. However, if you find that collisions still occur, you can increase the Threshold associated with the offending collider.

    To set the threshold for a given collider glyph, click the "Threshold" cell next to the collider glyph and type a number.

[Sticky!]

Managing the mort table


Note that some features which the user will see are added automatically (i.e., constructed by TrueEdit without the designer's intervention

TrueEdit automatically adds the name strings for effects when you add them to a font. However, if you don't like TrueEdit's names, you can still edit them. This is not recommended, since the names TrueEdit assigns are the standard feature names which should be constant across all fonts.

You can also decide which effects are set on by default in a font. A feature can still be turned off by the user if it has been set on by default.

It is also possible to change the order of effects within the mort table - this can lead to some strange and entertaining effects if not thought out properly.

Deleting effects


To delete, select the effect and choose Clear (or press Delete). When you delete a feature, TrueEdit automatically deletes the corresponding 'TRnn' table and the entries in the name table.

When you delete the entire mort table, TrueEdit deletes all of the 'TRnn' tables (except the ones to do kerning, which is not a mort feature) and all the appropriate entries in the name table.

Copying


You can't Cut, Copy, or Paste individual effects.

You can copy the entire mort table, but because of its dependencies on name, feat, and a bunch of TRnn tables, this is not recommended.

Ordering


Each effect is like a filter: only what passes through that filter gets down to the level below, and thus the next effect. This means that the sequencing of effects is very important.

To reorder effects within the mort table, just select the effect to be re-positioned...


...drag it...


...and drop it.


It is important to understand that the order of the feature registry (or of the effects in the font, or of this chapter, for that matter) does not dictate the order in which effect are presented to the font's end user in a GX application. Although Apple has provided extensive human interface guidelines for QuickDraw GX typography, each application may present a different view of your font.

Ordering within the table has absolutely nothing to do with ordering on any user interface in a GX app.


Chapter 6 will get into some detail on exactly how feature ordering influences the usability of the font.

Organizing and sequencing features


The following are some guidelines to coming up with the feature set and the glyph set for a font.

Each mort subtable can be thought of as a filter: only the output (either changed or unchanged) from subtable 1 gets to subtable 2, etc. So the ordering of the mort subtables has a big impact on both the complexity necessary within each subtable (it has to support whatever comes into it from the preceding subtables) and the user-perceived functionality of the font. You can rearrange the subtables by simply dragging them up or down in the mort window in TrueEdit as described above.

This is not the same as the order in the Feature Registry, nor is it the same as the order of things users see in the menu. Think of it like a fully factored application: the organization of the functionality inside is very different from the organization of the commands available to users.

The strategy I recommend is essentially: get the easy stuff out of the way, then tread carefully through the remaining maze. Here's how that might be applied to a semi-complex Roman font:

* These are "radio button" features, which require a mechanism to turn off the feature such as a "none" entry, even if it's blank

Get the shortest (dead-end) paths out of the way first:

Of the remaining effects, get the simplest paths out of the way first by doing those things which operate entirely within the mapped character set:

...then take care of figures:

Next, wade through the remaining effects:

Finally, clean up after yourself:


By looking at an existing GX font's mort table in TrueEdit, you can get feel for the normal order of effects in the mort table.

Setting defaults

Often, you want to make some effects take place automatically the first time the font is chosen, without any user intervention. Some applications will provide ways to access features, some won't. The following is a description of how to set the defaults for a font: how the font will always act in those applications which don't provide user access to features.

Select the entry and choose Get Info from the Edit menu.


You get a big dialog box.



Click the Default button to turn the effect on by default. You can set a default for each effect.

Text Orientation means whether the effect should be applied in horizontal or vertical text (which applies to non-Roman fonts).

Any table can be processed in either a forward or backward direction. The Glyph Processing Order option is used to determine this direction. Tables for Arabic fonts will tend to uncheck this box. Incidentally, Diagonal Fractions actually consists of two subfeatures, one going each way.

Note that TrueEdit doesn't prevent you from making nonsensical default settings, such as turning on both All Caps and Small Caps. That's because GX's Line Layout can actually process some of these effects in any order - turning on both All Caps and Small Caps would convert all lower case to capitals before the question of small caps comes up, if All Caps is first in order. However, you really should watch out for conflicts like this, because users will be very confused. While Layout can process both instructions, only the ordering of effects in the mort table would determine whether the results made sense or not.

Testing


Functional proofs check whether the features work the way they were intended, and whether the mort tables give reasonable relations between glyphs to produce the appropriate appearance. The designs of the outlines were fixed long ago, and we're not looking at the device-specific rendering. All that is needed is a general idea of which glyphs we're looking at and whether the tables are inserting them correctly, so checking on-screen will often be sufficient.

It's very hard to think of appropriate "abstract" tests which are any more specific than permutations and combinations such as:

Althoug not always necessary, printouts are sometimes very handy. Printouts would be most useful for things related to collision avoidance, where a higher resolution may reveal that a situation which looks bad on screen really is OK.


BackNextContents

Arleigh Movitz (movitz@applelink.apple.com)
Dave Opstad (opstad@apple.com)
Kristian Walsh (walsh.k@euro.apple.com)