MetricsMachine Documentation
Overview
No one likes kerning. MetricsMachine tries to help out by giving you a streamlined environment for getting your kerning over with as quickly as possible. There are several key things that you should understand before using the application.
Groups
In MetricsMachine you define kerning groups to link similarly shaped glyphs. Groups are defined for two sides side1
and side2
. These sides correspond to a glyph’s position within a kerning pair.
For example, a side2
group could consist of these glyphs:
And a side1
group could consist of these glyphs:
Be careful to not get too carried away with how deep you make your groups. OpenType has some table size limitations that can be triggered if you make your groups overly complex. Keep it logical and you should be alright.
PairTypes
MetricsMachine supports four kerning pair types:
pair types | |
---|---|
glyph, glyph | The left and right members are both glyphs. |
glyph, group | The left member is a glyph and the right member is a group. |
group, glyph | The left member is a group and the right member is a glyph. |
group, group | The left and right members are both groups. |
The group, group pair type is the highest-level pair possible. All of the other pair types can be used as exceptions to a higher-level pair. Exceptions allow you to have a value for all members of groups in a pair with special cases for specific members.
Workflow
MetricsMachine was designed with a specific workflow model in mind.
- Create context definitions. These will help you tremendously when kerning. You can do this stage once and reuse the definitions in many families.
- Finish the design of your typeface. Kerning is not fun and it is even less fun if you have to go back into the kerning because you changed serif structures.
- Build your groups. Take your time. These are important.
- Create pair lists. These will keep you on track during the kerning process.
- Kern. There is no avoiding this. Sorry.
- Export the kern feature. Export your kerning as a feature file and move on to more exciting things.
Editing Groups
All group editing is done in the Group Editor. This editor shows you all glyphs and allows you to add the glyphs to left and right groups. When you are finished editing, the application will adjust your kerning data based on the new groups.
1 Source Glyphs
All glyphs in the font. The glyphs are displayed with a color on the side1 and/or side2 indicating which group the glyph belongs to. To see a stacked preview of the currently selected glyphs hold the control key.
To add glyphs to a group, select the glyphs and drag them to the group in the group list or to the group preview.
The search field allows you to narrow down the glyphs on display using the search syntax. Hide grouped will hide glyphs grouped on the currently selected side.
2 Group Lists
These lists show the left and right groups. The counter shows how many glyphs are in each group.
3 Add and Remove
The add and remove group buttons add and remove groups to or from the current group list. If you have the ⌥
key down when the add group button is pressed, the selected glyphs will be automatically added to the new group. If you have the ⌘ key down when the add group button is pressed, the name of the first glyph in the current selection will be used as the name of the new group.
When naming groups, the names must adhere to the AFDKO syntax class name specification. The group editor will let you know if you have made an invalid group name. In some cases, MetricsMachine analyzes the group name to determine which member glyph should be used to display the group. Because of this, it is recommended that you name groups with the name of a glyph that you consider to be a good representative of the group.
4 Group Color
To change the color used to indicate a group in the glyph cells, select the group, press the color button and select a new color.
5 Group Preview
This shows all members of the currently selected group. There are two display modes Glyphs as shown above and Stack which shows all glyphs in the group stacked on top of each other.
To remove glyphs from a group, select the glyphs on display in Glyphs mode and press the delete key.
6 Import Groups
You can import groups from three possible sources: a MetricsMachine Groups file, another UFO or from a feature file containing a class kerning feature. Once you have selected a source file, the groups will be extracted and you will be presented with some importing options.
The list shows all groups that were found in the source file. The brackets show the side the groups belong to following the search syntax conventions. If you select Clear existing groups all existing groups will be removed.
7 Export Groups
You can export the groups to a MetricsMachine Groups file.
8 Auto Groups
MetricsMachine can automatically create some groups for you.
There are two ways that it can do this: Use decomposition rules will try to deduce the base glyph of an accented glyph by referencing Unicode values and the Unicode decomposition rules. For example, Aacute
will be grouped with A. The other option will try to group glyphs with suffixes in their names following the group structure of the base glyphs. For example, if zero
is in a group called MyZero
and you have zero.sc
, zero.sc
will move to a group called MyZero.sc
.
The results of auto-grouping should always be carefully checked.
9 Copy Groups
You can copy left groups to the right or vice-versa.
10 Color Groups
This will apply automatic coloring to all groups.
Editing Kerning
Most of the time in MetricsMachine will be spent in the main window. Interactive manipulation of kerning data is done here.
1 Pair List
This shows the pairs in the loaded list. When you first open a font, this list will be populated with all kerning pairs in the font.
2 Editing Controls
These controls manage the editing view. The text entry controls on the left represent left member of a pair, right member of a pair and the pair value. The popup in the middle controls the context definition that will be used to preview the pairs. If Automatic is selected, the application will find the first rule that matches the pair to be displayed. You can also choose a particular context definition and overrule the rule evaluation. The timeline on the right shows you how far you have progressed through the current pair list.
3 Editing View
This is the main view for editing pairs. A blue rectangle highlights the current pair within the view. You can optionally view pairs in a way that shows all members of the current group. This is called the Group Stack:
The editing view has a number of keyboard shortcuts that simplify the way you interact with the view:
Navigation | |
---|---|
↓ | Next pair in the pair list. |
↑ | Previous pair in the pair list. |
⇧+↓ | Next member of the group the left member of the pair belongs to. |
⇧+↑ | Previous member of the group the left member of the pair belongs to. |
⌥+↓ | Next member of the group the right member of the pair belongs to. |
⌥+↑ | Previous member of the group the right member of the pair belongs to. |
⌘+F | Flip the current pair. |
Editing | |
---|---|
← | -10 from the current pair value. |
→ | +10 to the current pair value. |
⇧+← | -5 from the current pair value. |
⇧+→ | +5 to the current pair value. |
⌥+← | -1 from the current pair value. |
⌥+→ | +1 to the current pair value. |
Exceptions
When you want to create an exception, the application will look at the possible exception types for the pair. If more than one type of exception is possible, you will be presented with an exception popup.
If you already have an exception for the pair, the application will catch this and alert you to the conflict.
4 Group Preview
This optional preview shows you the left member of the current pair plus all members of the right member of the pair’s group and vice-versa.
5 Glyph Data
This shows metrics data about each glyph in the edit view.
6 Typing Pane
This pane allows you to type arbitrary text for reference while kerning. This pane can automatically add suffixes to the glyph names of the string being previewed. For example, if you have typed HAMBURGEFONTS
and you select small from the popup button in the lower left corner, the view will display the equivalent of /H.small/A.small/ M.small/B.small/U.small/R.small/G.small/E.small/F.small/O.small/N.small/T.small/S.small
.
Conflict Resolution
While editing groups, you could create conflicting kerning data if your font already has kerning pairs. If this has happened, MetricsMachine will present the Conflict Resolution sheet. This sheet shows all of the conflicting pairs along with detailed information about how the conflicts will be resolved. The application does its best to work out how the conflicts should be resolved, but you should always review the resolutions to make sure that the correct decisions have been made.
1 Conflict List
This list shows all of the grouped pairs that have conflicting values. The list shows the members of the pairs, the pair values and the resolution type counts. Select one item in the list to see detailed information.
2 Resolution List
This list shows, from side1 to side2, the side1 and side2 pair members, pair value and resolution type for all conflicting pairs within the higher-level group pair. As mentioned above, MetricsMachine attempts to determine how you will probably want to resolve the conflicts. If you want to override the deduced resolutions, select from the options in the popup in the resolution type column. The options are:
Resulution list | |
---|---|
group value | The value that should be used as the value for the higher-level pair. |
exception | This pair should become an exception to the higher-level pair. |
follow group | This pair should take on the higher-level pair value. |
Spreadsheet
MetricsMachines’s Spreadsheet sheet shows you all of your kerning pairs as flat data.
1 Pair List
This list shows all kerning pairs in the font. The columns tell you the right and left members of the pair, the value of the pair and, if the pair is an exception, what the pair is excepting. The value column may be edited by double clicking the cell you wish to edit. If you want to delete one or more pairs, select the pairs and press the delete key.
2 Search Field
The search field allows you to narrow down the pairs in the list using the search syntax. 3 Display Mode The Spreadsheet sheet allows you to view your kerning data in two different ways: a simple list of all pairs and as a kerning topography.
4 Preview
A preview of the selected pair.
Kerning Topography
When viewing the kerning data in Topography mode, your pair data is presented as a grid of colored cells showing all possible kerning pairs in the font.
If a cell is black, the pair has an implicit zero value, meaning that there is no defined value for the pair. If the cell is red, the pair has a negative value. If the cell is yellow, the pair has a defined zero value. If the cell is green, the pair has a positive value. If a blue square appears in the middle of a cell, the pair is an exception. The positive and negative colors increase in intensity to indicate larger values. The pairs are grouped into subsections based on Unicode values and glyph name suffixes.
As you move the cursor over the view, a popup will give you data about the pair the cursor is currently over.
Transformations
MetricsMachine allows you to perform powerful transformations on your kerning data. These are created and applied in the Transformations sheet.
1 Transformation List
In this list you build a chain of transformations that you would like to perform. It is important to understand that each transformation builds on the result of the previous transformations. The transformation types are detailed below.
2 Transformation Settings
The settings for the currently selected transformation. In all transformation types, the pair and glyph entry fields use the search syntax.
3 Modified Pair List
All pairs that will be modified by the currently selected transformation. The displayed values are the values that will be in place after the transformation is complete.
4 Preview
A preview of the pair selected in the modified pair list.
5 Import Transformations
You can import the transformations from a MetricsMachine Transformations file.
6 Export Transformations
You can export the transformations to a MetricsMachine Transformations file.
Transformation Types
-
copy
This transformation type allows you to copy kerning pairs that match a particular pattern and insert replacements into the pairs. The Pattern defines the pairs that you want to copy. The Replacement fields, one for the left side of pairs and another for the right side of pairs, specify what should be inserted into the pairs. You can specify only a left or right replacement, or you can specify both left and right replacements at the same time. The specifics of what will be copied and where it will go, along with important warnings and errors, will be shown in the Details section. Pay careful attention to this report.
There are four copy types that can happen depending on the number of pairs found for Pattern and the number of glyphs/groups found for Replacement.
-
One To One
For example,
A → A.sc
will copy the values of all pairs containing A to A.sc. You must explicitly define groups in the Pattern or Replacement if you want to use a group. -
One to Many
For example,
A → A.sc
or{A*.sc}
or Aacute.sc or{Aacute.sc}
will copy the values of all pairs containingA
toA.sc
,Aacute.sc
, the group containingA.sc
and the group containing Aacute.sc. You must explicitly define groups in the Pattern or Replacement if you want to use a group. -
Many to One
For example,
A
or{A} → A.sc
will copy the values of all pairs containingA
toA.sc
. You must explicitly define groups in the Pattern or Replacement if you want to use a group. -
Many to Many
For example,
(uppercase) → (smallcaps)
will copy the values of all pairs containing a glyph in the reference group uppercase to a corresponding glyph in the reference group smallcaps. This will also try to automatically match as many groups as possible for any glyphs defined in Pattern and Replacement. The Details section should always be reviewed when making a Many to Many copy. -
Remove
This transformation removes all pairs found for Pattern.
-
Scale
This transformation scales all pairs found for Pattern by Value.
-
Shift
This transformation adds Value to all pairs found for Pattern.
-
Round
This transformation rounds all pairs found for Pattern to increments defined by Value. Remove redundant exceptions will eliminate all exceptions that match the pair that they are excepting.
-
Threshold
This transformation removes all pairs found for Pattern that have a value greater than negative Value and less than positive Value. Remove redundant exceptions will eliminate all exceptions that match the pair that they are excepting.
Reference Groups
It is often useful to have font specific categories or groups of glyphs for reference. These groups can be used in when searching for glyphs, performing transformations or building pair lists. In MetricsMachine these groups are called reference groups.
1 Source Display Options
The search field allows you to narrow down the glyphs on display using the search syntax. Hide current group hide glyphs in the current group.
2 Source Glyphs
To add glyphs to a group, select the glyphs and drag them to the group in the group list or to the group preview.
3 Group List
4 Group Contents
5 Import Groups
You can import reference groups from another UFO.
Context Definitions
One of the most difficult parts of kerning is preparing contexts in which to view all of the pairs. MetricsMachine gives you a powerful way to create contexts for pairs on the fly. These context definitions will be evaluated whenever you want to view a pair. For example, you can define a context for pairs of the type figures
, figures
and when you look at three
, four
your context definition will be matched and used to display the preview. These context definitions are created and managed in MetricsMachine’s Preferences window.
1 Context Definitions List
This list shows all the definitions that the application will evaluate for each pair and the order in which they will be evaluated. If you want to reorder definitions, simply drag and drop within the list.
2 Add, Remove, Duplicate
Add, remove and duplicate context definitions.
3 Context Definition Settings
Name
A unique name for the context definition.
Long Context
This defines the long preview string for the context definition. This will be used throughout the interface to preview pairs. This should be a / separated list of glyph names. There are six special keywords that can be used to dynamically update the preview strings:
keyword | |
---|---|
$LEFT | The left member of a kerning pair. |
$RIGHT | The right member of the kerning pair. |
$LEFTCLOSE | The closed partner for the left member of the pair. For example if ( is the left member of the pair, the left closed partner will be ). |
$LEFTOPEN | The open partner for the left member of the pair. For example if ) is the left member of the pair, the left open partner will be (. |
$RIGHTCLOSE | The closed partner for the right member of the pair. For example if ( is the right member of the pair, the right closed partner will be ). |
$RIGHTOPEN | The open partner for the right member of the pair. For example if ) is the right member of the pair, the right open partner will be (. |
For example, if your long context is /H/H/$LEFT/$RIGHT/H/H
and the pair to be viewed is A
, B
the string that will be used for the preview is /H/H/A/B/H/H
.
Short Context
This defines the short preview string for the context definition. This will be used in the group preview in the main editor. The special keywords defined for the long context can also be used in the short context.
Enabled
Check to enable the context definition for matching.
Suffix Matching
If checked, when a context is matched, the application will take the suffix from the members of the pair and try to apply it to members of the preview string. If glyph names are matched, these glyph names will be used for the preview string. For example, if your long context for figures is /one/one/$LEFT/$RIGHT/one/zero/one/zero/
zero
and the pair being viewed is three.lining
, four.lining
, the application will take
the .lining suffix from the pair and try to apply it to the glyph names in the context. In this case, the string that the application will try to match is /one.lining/one.lining/
three.lining/four.lining/one.lining/zero.lining/one.lining/zero.lining/zero.lining
.
Pseudo Unicodes
When checked the application will attempt to create a pseudo-Unicode value for any glyphs that do not have a defined Unicode value. This allows glyphs such as A.alt to be handled using the same rules as A.
4 Pair Matching Rules
Within each context definition you create one or more matching criteria for each side of a kerning pair. These are the criteria that will be used to evaluate a match for each pair. The glyph data that can be matched are:
Anything | Matches all glyphs. |
---|---|
Name | The glyph’s name. |
Unicode Value | The glyph’s Unicode value. |
Unicode Category | The category of the glyph’s Unicode value. |
Unicode Script | The script that the glyph’s Unicode value is in. |
Unicode Block | The block that the glyph’s Unicode value is in. |
5 Import and Export
You can import and export your context definitions into an external file.
Importing Kerning
You can import kerning from UFOs or kerning feature files. When kerning is imported, all of your groups will be removed and replaced with the groups in the file you are importing from. Importing from a feature file should be done only if you do not have a UFO available.
Exporting Kerning
MetricsMachine exports kerning in two formats: as an AFDKO ready kern feature or as an AFM file. When exporting a feature file, you can export to an external file or add the kern feature to the features inside of the UFO. Yo can also instruct the application to insert subtable breaks if you need them. This should only be done only if a feature file without the breaks is causing an overflow when your OpenType font is compiled.
Pair Lists
The pair lists used to display pairs in the main window can have two formats: Pairs or Words. Pairs format specifies two glyph names and MetricsMachine will use your context defintions to display the pairs. Words format specifies both the pair and the context used for display.
Pairs Format
The first line of the file must start with #KPL:P
: followed by a title for the list. Pairs are specified as two glyph names separated by a space. You can add comments by starting a line with #
.
#KPL:P: LC Pairs
aa
ab
ac
ad
o question
Words Format
The first line of the file must start with #KPL:W: followed by a title for the list. Pairs are specified as two groups of characters or glyph names separated by a space. The pair consists of the last character of the first group and the first character of the second group. If you want to specify glyph names, the glyph names must be separated by a /. You can add comments by starting a line with #
.
#KPL:W: All Words
baza ar
ha bits
ba ck
ha drian
/h/e/l/l/o /question
Pair List Builder
Building pair lists by hand in a text editor is not fun. To make this process easier, MetricsMachine has a drag and drop interface for creating pair lists.
1 Source Display Options
The search field allows you to narrow down the glyphs on display using the search syntax. The checkboxes will allow you to hide glyphs in the left or right side lists.
2 Source Glyphs
All glyphs in the font.
3 Side Lists
The list on the left contains the glyphs that you want to be on the left side of pairs and the list on the right contains the glyphs that you want to be on the right side of pairs. To add glyphs to one of these lists, select glyphs in the source list and drag to the desired list. To remove glyphs, select the glyphs and press the delete key.
4 Sort Dropped Glyphs
If checked, this will sort the glyphs in the side list following a preset order. Otherwise, the glyphs will be stored in the order you dropped them into the list.
5 Compile and Import
Compile
This will iterate over the left side glyphs and the right side glyphs and create pairs. For example, if your left list contains A and B and your right list contains C and D, four pairs will be compiled: A+C, A+D, B+C and B+D.
Import
This will allow you to import pairs from an existing pair list.
6 Pair List Title
7 Compilation Options
Create Flipped
When checked, this will create flipped versions of the pairs created by the compile operation. For example, if your left list contains A and B and your right list contains C and D, four pairs will be compiled: A+C,
C+A
, A+D
, D+A
, B+C
, C+B
, B+D
and D+B
.
Avoid Duplicates
When checked, any pairs generated by the compile operation that are already in the pair list will not be added to the pair list.
Compress Groups
When checked, this will scan the glyphs in a side list, make note of the glyphs that are in the same group and only use one of the group members to compile pairs.
Create Open+Closed
When checked, this will create open, right and right, closed pairs based on your left and right glyphs. For example, given parenleft in your left list and A in your right list, this will generate the pairs: parenleft, A and A, parenright.
Create Closed+Open
When checked, this will create closed, right and right, open pairs based on your left and right glyphs. For example, given quoteright in your left list and A in your right list, this will generate the pairs: quoteright, A and quoteleft, A.
8 Pairs List
9 Save Pair List
10 Use Pair List
Occasionally you don’t need to save a pair list. This button will send the pairs in the list directly to the kerning editor for immediate use.
Search Syntax
Throughout MetricsMachine you can narrow down the glyphs or kerning pairs on display by using the application’s powerful search syntax.
Wildcards | | —|—
- | Matches everything. For example, A* will match anything that starts with A. ? | Matches one character. For example, A? will match anything that starts with A and is followed by exactly one character.
Groups | |
---|---|
[ | Matches a right group name. For example, [A* will match any right group name that starts with A. |
] | Matches a left group name. For example, A*] will match any left group name that starts with A. |
[] | Matches a left or right group name. For example, [A*] will match any left or right group name that starts with A. |
{ | Finds the right group for a glyph. For example, {A* will match any right groups that contain glyphs that start with A. |
} | Finds the left group for a glyph. For example, A*} will match any left groups that contain glyphs that start with A. |
{} | Finds the left or right group for a glyph. For example, {A*} will match any left or right groups that contain glyphs that start with A. |
() | Matches a reference group name. For example, (A*) will match any reference group name that starts with A. |
Operators
Operators allow you to combine two or more sub-patterns to create intersections, unions or exclusions.
Operators | |
---|---|
and | Creates an intersection of two sub-patterns. For example, A* and *.alt will give you anything starting with A and ending with .alt. |
or | Creates a union of two patterns. For example, A* or *.alt will give you anything starting with A or ending with .alt. |
not | Excludes something from a pattern. For example, A* not *.alt will give you anything starting with A but not anything ending with .alt. |
Kerning Pairs
When searching a list of kerning pairs you have some additional options. Searches as described above will work, but you can also search for specific pairs by using a comma as a separator. For example, if you search for A* you will get all pairs that contain a glyph name that starts with an A on either the left or the right. If you search for A, B you will get all pairs that contain a glyph name starting with A on the left and a glyph name starting with a B on the right. In addition to these, several variables exist for matching types of pair members.
Search | |
---|---|
all | Matches everything. |
group | Matches any group. |
glyph | Matches any glyph. |
exception | Matches any exception. |
For example, A*, all matches all pairs that have a glyph name on the left that starts with an A.