This appendix documents miscellaneous internal technical details of TrueEdit which may be of interest to font developers.
Much of the binary data in the mort
,
kern
, and just
tables is compiled from
source-format tables. These source tables have names of the form
TR
nn
, where nn is a
two-digit number. (The EDT0
and EDT1
tables
are not used by TrueEdit.)
In general, source tables are introduced only when necessary;
whenever possible, the binary data is decompiled instead. One kind of
data that is very difficult (or impossible) to decompile is a state
table; therefore, for each kind of state table that may be present in
a font, a corresponding source table has been defined.
The usage and formats of all the
TR
nn
tables currently used by
TrueEdit are documented below.
The TR00
table is used to compile the
mort
subtable that implements the Required Ligatures
feature setting. It has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The number of ligatures in the table | |||
|
|
The ligatures list, sorted in increasing dictionary order of the component glyph ids. (By "dictionary order", what is meant is the ordering of strings as in a dictionary, i.e. sorting on the first glyph, then on the second, then on the third, and so on.) |
Each SrcLig
has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The glyph ID of the ligature | |||
|
|
The number of component glyphs in the ligature (2 or 3) | |||
|
|
The glyph IDs of the component glyphs |
The TR01
table is used to compile the
mort
subtable that implements the Common Ligatures
feature setting. It has the same format as the TR00
table.
The TR02
table is used to compile the
mort
subtable that implements the Rare Ligatures feature
setting. It has the same format as the TR00
table.
The TR03
table is used to compile the
mort
subtable that implements the Logos feature setting.
It has the same format as the TR00
table.
The TR04
table is used to compile the
mort
subtable that implements the Rebus Pictures feature
setting. It has the same format as the TR00
table.
The TR05
table is used to compile the
mort
subtable that implements the Cursive feature
setting.
At the moment, this table is capable of implementing only the kind of cursive script found in Arabic text. It is not capable of implementing Roman cursive text. At some point in the future TrueEdit may support Roman cursive, at which time the format of this table will have to change.
The TR05
table currently has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The number of cursive entries in the table | |||
|
|
The number of kashida glyphs in the table | |||
|
|
The number of vowel glyphs in the table | |||
|
|
The smallest kashida glyph ID in the table | |||
|
|
The largest kashida glyph ID in the table | |||
|
|
The smallest vowel glyph ID in the table | |||
|
|
The largest vowel glyph ID in the table | |||
|
|
The smallest standalone glyph ID in the table | |||
|
|
The largest standalone glyph ID in the table | |||
|
|
The smallest final glyph ID in the table | |||
|
|
The largest final glyph ID in the table | |||
|
|
The glyph IDs of the kashidas in the table, in increasing glyph ID order | |||
|
|
The glyph IDs of the vowels in the table, in increasing glyph ID order | |||
|
|
The list of cursive entries in the table, sorted in increasing order of the glyph ID of the standalone form of the glyph in each cursive entry |
Each QuadrupleRec
has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The glyph ID of the standalone form of the glyph | |||
|
|
The glyph ID of the final form of the glyph | |||
|
|
The glyph ID of the medial form of the glyph | |||
|
|
The glyph ID of the initial form of the glyph |
The TR06
table is used to compile the
mort
subtable that implements the Show Diacritics
feature setting. It has the same format as the TR00
table.
The TR07
table is used to compile the
mort
subtable that implements the Hide Diacritics
feature setting. It has the same format as the TR00
table.
The TR08
table is used to compile the
mort
subtable that implements the Ordinals feature
setting. It has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The number of digit glyphs in the table | |||
|
|
The number of (letter, superior) entries in the table | |||
|
|
The smallest digit glyph ID in the table | |||
|
|
The largest digit glyph ID in the table | |||
|
|
The smallest letter glyph ID in the table | |||
|
|
The largest letter glyph ID in the table | |||
|
|
The list of digits that can take ordinals, sorted in increasing glyph ID order | |||
|
|
The list of (letter, superior) entries, sorted in increasing order of letter glyph ID |
Each DigitRec
has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The glyph ID of a digit | |||
|
|
A flag indicating whether the corresponding cell in the TrueEdit edit window is currently selected (i.e., highlighted) |
LetterRec
has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The glyph ID of a letter | |||
|
|
The glyph ID of the superior form of the letter | |||
|
|
A flag indicating whether the corresponding cell in the TrueEdit edit window is currently selected (i.e., highlighted) |
The TR09
table is used to compile the
mort
subtable that implements the Vertical Fractions
feature setting. It has the same format as the TR00
table.
The TR10
table is used to compile the
mort
subtable that implements the Diagonal Fractions
feature setting. It has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
uint16 |
numTriplets |
The number of (digit, numerator, denominator) entries in the table | |||
|
|
The number of slash glyphs in the table | |||
|
|
The smallest slash glyph ID in the table | |||
|
|
The largest slash glyph ID in the table | |||
|
|
The smallest digit glyph ID in the table | |||
|
|
The largest digit glyph ID in the table | |||
|
|
The smallest denominator glyph ID in the table | |||
|
|
The largest denominator glyph ID in the table | |||
|
|
The list of slashes, sorted in increasing glyph ID order | |||
|
|
The list of (digit, numerator, denominator) entries, sorted in increasing order of the digit glyph IDs |
SlashRec
has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The glyph ID of the slash | |||
|
|
A flag indicating whether the corresponding cell in the TrueEdit edit window is currently selected (i.e. highlighted) |
TripletRec
has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The glyph ID of a digit | |||
|
|
The glyph ID of the numerator form of that digit | |||
|
|
The glyph ID of the denominator form of that digit | |||
|
|
A flag indicating whether the corresponding cell in the TrueEdit edit window is currently selected (i.e. highlighted) |
The TR11
table is used to compile the
kern
subtable that implements Contextual Kerning. It has
the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The list of contextual kerning entries. Each entry describes a sequence of up to eight glyphs, as well as the kerning values between these glyphs. The number of entries in the table is determined by dividing the size of the table by the size of an entry |
KernOctalRec
has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The number of glyphs in the contextual kerning string | |||
|
|
The glyph IDs of the glyphs composing the string | |||
|
|
The kerning values that apply between the glyphs in the string | |||
|
|
A flag indicating whether the corresponding row in the TrueEdit edit window is currently selected (i.e. highlighted) |
The TR12
table is used to compile the
kern
subtable that implements Class-Based Kerning. Its
format is not documented here because this table may be removed in
future versions of TrueEdit.
The TR13
table is used to compile the
just
table, which implements Justification. Its format
is not documented here at this time because:
(1) It is quite complex
(2) It will probably change with future versions of the
just
editor in TrueEdit.
The TR14
table is used to compile the
mort
subtables that implement the various Smart Swashes
feature settings (Word Initial Swashes, Word Final Swashes, Line
Initial Swashes, Line Final Swashes, and Non-Final Swashes). It has
the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
subtableType[5] |
Five flags indicating whether each of the corresponding
five Smart Swashes settings currently exists in the
| |||
|
|
The number of swash entries in the table | |||
|
|
The number of punctuation glyphs in the table | |||
|
|
The number of special glyphs in the table | |||
|
|
The smallest normal, i.e. non- swash, glyph ID in the table | |||
|
|
The largest normal, i.e. non- swash, glyph ID in the table | |||
|
|
The smallest punctuation glyph ID in the table | |||
|
|
The largest punctuation glyph ID in the table | |||
|
|
The smallest special glyph ID in the table | |||
|
|
The largest special glyph ID in the table | |||
|
|
The glyph IDs of the punctuation glyphs, sorted in increasing glyph ID order | |||
|
|
The glyph IDs of the special glyphs, sorted in increasing glyph ID order | |||
|
|
The swash entries, sorted in increasing glyph ID order of the normal, i.e. non-swash, form of the glyph in each swash entry |
Each MortSwashRec
record has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The glyph ID of the normal, i.e. non-swash, form of the glyph | |||
|
|
The glyph ID of the Word Initial swash form of the glyph | |||
|
|
The glyph ID of the Word Final swash form of the glyph | |||
|
|
The glyph ID of the Line Initial swash form of the glyph | |||
|
|
The glyph ID of the Line Final swash form of the glyph | |||
|
|
The glyph ID of the Non Final swash form of the glyph |
The TR15
table is used to compile the
mort
subtable that implements the Diphthong Ligatures
feature setting. It has the same format as the TR00
table.
The TR16
table is used to compile the
mort
subtable that implements the Prevent Overlap
feature setting. Information on its format will be added to a later
version of this document.
The TR17
table is used to compile the
mort
subtable that implements the Hyphens to Em Dash
feature setting. It has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The glyph ID of the hyphen | |||
|
|
The glyph ID of the em dash |
The TR18
table is used to compile the
mort
subtable that implements the Hyphen to En Dash
feature setting. It has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The glyph ID of the hyphen | |||
|
|
The glyph ID of the en dash | |||
|
|
The number of space glyphs in the table | |||
|
|
The number of digit glyphs in the table | |||
|
|
The smallest space glyph ID in the table | |||
|
|
The largest space glyph ID in the table | |||
|
|
The smallest digit glyph ID in the table | |||
|
|
The largest digit glyph ID in the table | |||
|
|
The glyph IDs of the space glyphs, sorted in increasing glyph ID order | |||
|
|
The glyph IDs of the digit glyphs, sorted in increasing glyph ID order |
The TR19
table is used to compile the
mort
subtable that implements the Asterisk to Multiply
feature setting. It has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The glyph ID of the asterisk | |||
|
|
The glyph ID of the multiplication sign | |||
|
|
The number of space glyphs in the table | |||
|
|
The smallest space glyph ID in the table | |||
|
|
The largest space glyph ID in the table | |||
|
|
The glyph IDs of the space glyphs, sorted in increasing glyph ID order |
The TR20
table is used to compile the
mort
subtable that implements the Exponent feature
setting. It has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The glyph ID of the caret | |||
|
|
The number of digit glyphs in the table | |||
|
|
The smallest digit glyph ID in the table | |||
|
|
The largest digit glyph ID in the table | |||
|
expDigitRecs[numDigits] |
The list of (digit, exponent) entries in the table, sorted in increasing glyph ID order of the digits |
MortExpDigitRec
has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The glyph ID of the digit | |||
|
|
The glyph ID of the corresponding exponent |
The TR21
table is used to compile the
mort
subtable that implements the Hyphen to Minus
feature setting. It has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The glyph ID of the hyphen | |||
|
|
The glyph ID of the minus sign | |||
|
|
The number of space glyphs in the table | |||
|
|
The smallest space glyph ID in the table | |||
|
|
The largest space glyph ID in the table | |||
|
|
The glyph IDs of the space glyphs, sorted in increasing glyph ID order |
The TR22
table is used to compile the
mort
subtable that implements the Slash to Divide
feature setting. It has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The glyph ID of the slash | |||
|
|
The glyph ID of the divide sign | |||
|
|
The number of space glyphs in the table | |||
|
|
The smallest space glyph ID in the table | |||
|
|
The largest space glyph ID in the table | |||
|
|
The glyph IDs of the space glyphs, sorted in increasing glyph ID order |
The TR23
table is used to compile the
mort
subtable that implements the Inequality Ligatures
feature setting. It has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The glyph ID of the "greater than" sign | |||
|
|
The glyph ID of the "less than" sign | |||
|
|
The glyph ID of the equal sign | |||
|
|
The glyph ID of the "greater than or equal to" sign | |||
|
|
The glyph ID of the "less than or equal to" sign |
The TR24
table is used to compile the
mort
subtable that implements the Initial Caps feature
setting. It has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The number of (lower case, upper case) glyph pairs in the table | |||
|
|
The number of space glyphs in the table | |||
|
|
The smallest lower case glyph ID in the table | |||
|
|
The largest lower case glyph ID in the table | |||
|
|
The smallest space glyph ID in the table | |||
|
|
The largest space glyph ID in the table | |||
|
|
The list of (lower case, upper case) glyph pairs, sorted in increasing order of the lower case glyph ids | |||
|
|
The glyph IDs of the spaces, in increasing glyph ID order |
Each MortUpperPairRec
has the following format:
Type |
Name |
Description | |||
---|---|---|---|---|---|
|
|
The glyph ID of a lower case glyph | |||
|
|
The glyph ID of the corresponding upper case glyph |
Information on this table will be added to a later version of this
document.
Information on this topic will be added to a later version of this
document.
mort
tableThe format of the mort
table is specified in
QuickDraw GX Font Formats. In addition, 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 at present 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.
The following are the assumptions made by TrueEdit regarding the
overall layout of the mort
table:
mort
table consists of a single chain, i.e.
contains at most 32 feature settings.
mort
table
main window.
mort
table is
the same as the order, in the Feature List, of the
feature settings which they implement. If more than one subtable
is needed to implement a particular feature setting, all those
subtables will be contiguous, and, as a group, they will be in
Feature List order.
Currently, the only feature setting that requires more than one
subtable to implement is Diagonal Fractions. It requires two
subtables: one to scan the run in the forward direction, and one to
scan the run in the reverse direction.
TrueEdit makes no assumptions about how many subtables are used to
implement each feature setting; it can deduce this information from
the Subfeature Flags of the subtables, and the Enable Flags of the
Feature List entries (more on this below).
CHMP
resourceThe "Build & Add" option available in TrueEdit for adding a
cmap
subtable is useful because it allows the user to
add a complete subtable, without having to specify any of the new
subtable's entries. The entries in the new subtable are determined by
the platform, script, and language IDs specified by the user.
TrueEdit determines the format (0, 4, or 6) of the new subtable based
on its contents.
The new subtable is built by using a CHMP
resource (from
TrueEdit's resource file) in conjunction with an existing
cmap
subtable in the font. Details of the
CHMP
resource follow.
The CHMP
resource maps character codes in a source
(src) encoding to those in a destination (dest) encoding. For
example, one CHMP
might map Mac-Roman-English character
codes to their Unicode-Roman-English equivalents, another might map
Mac-Roman-Dutch codes to Microsoft-Roman-Dutch codes, etc. There may
be one CHMP
resource for each mapping from one set of
encoding IDs to another. If CHMP
resources with
duplicate encoding IDs exist, the first applicable CHMP
will be used.
The following diagram shows how an existing cmap
subtable in an sfnt
and a CHMP
which shares
a similar set of encoding IDs (differing only in platform) can be
used to generate a new cmap
subtable. The new
cmap
subtable maps each destination character code in
the CHMP
to the glyph index which is mapped to in the
existing cmap
subtable by the corresponding source (Mac)
character code in the CHMP
.
In the Add cmap
Subtable dialog, TrueEdit allows the
user to specify the platform, script, and language IDs of the
cmap
subtable to be added. The Build & Add button in
this dialog will be highlighted, enabling a cmap
subtable to be built from a CHMP
resource and an
existing cmap
subtable, if the following conditions
hold:
sfnt
with
the same script and language IDs as the subtable to be added but
with "Macintosh" as a platform.
CHMP
resource in TrueEdit's resource
file which meets the following requirements:
ResEdit should be used to create or modify CHMP
resources.
If a CHMP
is being created outside of the TrueEdit
resource file, create a new resource file or open an existing one in
ResEdit and choose "Create New Resource" from the Resource
menu. Enter CHMP in the text field, and a new window (a hex window)
will appear.
If a resource file which already contains CHMP
s is being
used, double-click CHMP
in the list and choose "Create
New Resource".
In either case, the new CHMP
can be built once a hex
window has been created for it in ResEdit. The following is a
representation of the format of the CHMP
resource.
Note that:
CHMP
resource are in hexadecimal.
CHMP
character codes are two bytes in length.
CHMP
or mapped to character code 0xFFFF
.
Below is a screen snapshot taken in ResEdit. It shows an actual
CHMP
with its components labeled. This particular
CHMP
maps 256 Macintosh-Roman-English character codes to
the equivalent 256 Unicode-Roman-English codes. Notice the block of
FFFF
s, which denote those codes which exist in the
source encoding (Mac-Roman-English) but not in the destination
encoding (Unicode-Roman-English).
It is simple, though a bit tedious, to create CHMP
s. The
benefit of spending the time creating a CHMP
is that
TrueEdit users will not have to spend time on painful and repetitive
entry of character codes and their associated glyph indices; this
process is automated by the presence of CHMP
resources.
Consult the documents TrueType Font Format
Specification and QuickDraw GX Font Formats for
more information on cmap
s. The latter document offers an
in-depth explanation of the different cmap
formats,
including format 2, which might be useful in working with
cmap
s.