microsoft.com Home   All Products  |   Support  |   Search  |   microsoft.com Home  
Microsoft

Microsoft Typography | Developer | VOLT specification
UI | Main | Proj window | Glyph grp | Subs tool | Posi tool | Glyph def | Proof tool | Output


Substitution Tool

Description

The substitution tool allows the user to view and edit both regular and contextual substitution lookups. The tools opens when the user double-clicks on a substitution lookup on the project panel.

illustration

Composition

The Substitution Tool contains the following components:

  • Lookup Name Field
  • Lookup Type Field. This field is updated automatically as substitutions are entered. Namely:
    • if the "Using" field is not empty, it's a Contextual Substitution;
    • if there are one-to-many substitutions, it's Multiple Substitution;
    • if there are many-to-one substitutions, it's Ligature Substitution;
    • if there are one-to-one substitutions with the same left-hand sides, it's Alternate Substitution;
    • otherwise it's Single Substitution.
    • If substitution types are mixed, the Lookup Type field reads Invalid (in red). If the error condition is not corrected, a compilation error will be reported for this lookup.
  • Lookup Flags field. It contains two sub-fields:
    • "Process Base Glyphs" checkbox. If not checked, the lookup will have "Ignore Base Glyphs" and "Ignore Ligatures" set. Checked by default.
    • "Process Marks" drop-down box. The valid values for this box are:
      • ALL - marks are not ignored
      • NONE - the 'Ignore Marks" flag will be on for the lookup
      • One of the defined glyph groups. This group will be included as a separate mark attachment class in GDEF and the corresponding index will be set in the "Mark Attachment" field for the lookup. If the group does not consist of marks only, or groups used in this field in different lookups intersect, an error is reported during compilation.
  • Parallel lists of substitutions: expressed using glyph names (editable), expressed using glyph shapes (not editable, updated automatically) and the alternate index column (updated automatically)
  • The "Using" field.

Substitutions are entered into the Substitution List (glyph names) by editing it as if it were a text window. Each line represents one substitution in format <glyph name(s)> à  <glyph name(s)>. As soon as the user moves away from an edited line, the corresponding line in the Substitution List (glyph shapes) is updated as well. If the line does not contain a valid substitution in the format described above, a red error symbol appears instead. If a glyph group name is used (see below) the shape for the first member of the group is displayed and marked as a group representative by color change (e.g. displayed in blue).

If more than one line has the same left-hand side, the lookup is presumed to be an alternate substitution lookup and the substitutions that share the same left-hand side are automatically numbered with consecutive indexes in the alternate index column. To change those indexes one has to re-order the substitutions in the lookup.


Actions


Changing Lookup Flags

Checking or un-checking the "Process Base Glyphs" checkbox switches the "Ignore Base Glyphs" and "Ignore Ligatures" flags on and off.

The drop-down list under "Process Marks" is at any time filled with items 'ALL', 'NONE' and names of all glyph groups currently defined in the project. Compilation errors will be reported if the mark groups used in different lookups are not compatible or contain non-mark glyphs.


Adding and Removing Substitutions

One can edit the Substitution List (glyph names) very much like a regular text window. Pressing enter at the end of a line produces a new substitution entry; the backspace and delete keys remove regular characters as well as carriage returns. The parallel list with glyph shapes and the alternate index column are updated automatically as described above. While editing the substitution list, copying, cutting, pasting and drag-and-drop of text should be available to the user.

Dragging a glyph from the Glyph Definition Tool into the text inserts the glyph's name. Dragging from the Glyph Group list in the Project Window inserts a group's name in angular brackets (see below).


Changing Order of Substitutions

To change the order of substitutions one has to cut and paste them in the Substitutions List (glyph names). The other lists will be updated automatically.

Defining Contextual Substitutions

By typing into the "Using" text field one changes the lookup type to Contextual Substitution. Each line in that field should represent a lookup name. If such a lookup is not found an error will be reported during compilation.

When working with the "Using" text field one can copy, cut, paste, drag and drop.


Scrolling

The substitution lists are scrollable both up and down and left to right (substitutions expressed via glyph names could be rather long). The "Using" list is scrollable up and down.


Compilation

Regular Substitutions

The lookup is compiled with the defined flags and substitutions. If the formats of substitutions are not compatible, an error is reported. The substitutions are compiled in the order they appear in the list (see below regarding use of glyph groups) except they may be re-ordered by the glyph ID of the first glyph as required by the lookup format (such reordering does not change the result of the substitution).

Ambiguity may be detected during compilation if two substitutions have the same left-hand side. If the lookup cannot be classified as alternative substitution lookup, a compilation error is reported in this case.


Use of Glyph Groups

Both explicit and named glyph groups can be used in substitutions in place of glyph names.

An explicit glyph group is a range of glyph names, or a sequence of glyph names, or a mix, surrounded by curly brackets.

For example: {capA, capB}, {capA-capZ} or {capA-capZ, digit1-digit9}

A named glyph group is represented by the name of one of glyph groups defined in the project, in angular brackets. For example: <CapitalLetter> or <Punctuation>.

All groups referenced in the one substitution have to have the same cardinality. If this condition is not satisfied, an error is reported during compilation.

A substitution that uses glyph groups is equivalent to a number of substitutions where all references to glyph groups are replaced by the first, second etc. up to the last glyph of the corresponding groups. Thus the use of glyph groups in regular substitutions is for shorthand purposes only.


Contextual Substitutions

If the "Using" field is not empty the lookup is assumed to be a contextual substitution. Then

  • the left hand sides of the substitutions in the Substitution List from all contexts used in the lookup. The contexts are compiled into rules and sub-rules (by first reordering them by the leading glyph ID);
  • the right-hand side of every substitution defines the form in which the left-hand side has to be transformed. VOLT finds the sequence in which the lookups listed in the "Using" field have to be applied to guarantee the resulting form. If such a sequence of applications cannot be found unambiguously, a compilation error is reported.
  • If not all lookup names in the "Using" field can be resolved, an error is reported.

It is reasonable to restrict a VOLT user to using only lookups with uniform left- and right-hand sides (that is, only to lookups where all substitutions have the left hand sides of the same length, and the same for the right hand sides). If a lookup not conforming to this requirement is inputted into the "Using" field, a compilation warning is reported.

Note that when looking for the right application sequence VOLT engine has to take into account that lookups may skip certain glyphs (bases, marks or marks not belonging to a group).

For looking for the correct application sequence, an exhaustive search a few applications deep should work well enough. The depth of the search could be controlled from the "Options" menu.


Use of Glyph Groups

If possible, all glyph groups used are compiled together into one class def. This class def is then used for defining the contexts, and the lookup is compiled as a class-based context substitution. If the groups used in the lookup intersect, the coverage-based format is used instead.

Note that there is no reason why group cardinalities have to match in contextual substitutions. Nor are substitutions with groups expanded into multiple ones. Instead, groups are used to define coverage or class definitions to be used when describing contexts and desired results of contextual substitutions.


Chaining

The lookup is compiled as a chaining one whenever possible:

  • the maximum leading sequence matching in the left and right hand sides of a substitution becomes the backtracking sequence;
  • the maximum trailing sequence matching in the left and right hand sides of a substitution becomes the look-ahead sequence.


Round-tripping

The contents of the Substitution Tool has to round-trip fully. In particular, the order of substitutions, group names and explicit group definitions in lookups should be preserved.



this page was last updated 13 August 1999
© 1999 Microsoft Corporation. All rights reserved. Terms of use.
comments to the MST group: how to contact us

 

UI | Main | Proj window | Glyph grp | Subs tool | Posi tool | Glyph def | Proof tool | Output
Microsoft Typography | Developer | VOLT specification