In OpenType-TT (TrueType) fonts, the hinting process is very different from the one used in OpenType-PS (Type 1) fonts. In TrueType font format, almost all characters have special programs that directly control the movement of outline points at different PPM sizes.
The native TrueType instruction language consists of several dozen commands. All the commands deal with the data stack, a temporary storage place, and the constant definitions that come with a font.
There are 3 different kinds of instructions in each TrueType font file. One global program (called the Font Program) is executed one time when the font is used for the first time. Another global program (called the PPM Program) is executed one time when the font’s PPM is changed. Local programs (Glyph Programs) are executed for each glyph when it is scaled.
When you import a hinted OpenType-TT font, FontLab shows small blue
T marks in the glyph cells:
which means glyphs have local hinting programs in the binary form. FontLab cannot decompile this program to present it in some readable text format, so you cannot edit TrueType hints in the imported font. If you change glyph’s contours the program will be dropped and the glyph will need new hinting program.
Visual TrueType Hints»
In FontLab we use a small set of high-level hinting instructions that are automatically compiled to TrueType instructions during font export. Because these instructions can be set and edited visually we call them visual TrueType hints or just visual hints.
Visual hints are enough to define TrueType hints even in very complex situations and they are compiled in very compact and effective TrueType instruction code.
The visual hint set includes the following commands:
|Align||Aligns (moves) the position of the outline point to the designated position on the grid or to the edge of the alignment zone|
|Single Link||Sets the position of the point relative to the position of another point. Distance can be linked with one of the stem widths. Distances also may be rounded or not|
|Double Link||Sets the distance between two points to an integer value that may be linked with a stem width|
|Interpolate||Interpolates the position of a point between two other points|
|Middle Delta||Slightly shifts a point at a specific PPM. This command works before the final interpolation of untouched points|
|Final Delta||Slightly shifts a point at a specific PPM. This command works after the final interpolation of untouched points. This command is used for the final outline correction.|
All commands are available in horizontal and vertical directions. There are no “diagonal” visual instructions.
Sequence of commands
Visual commands may be set in any sequence, but they are interpreted in a very specific order. FontLab automatically detects the logic of the hinting program and does intelligent sorting.
- Align commands are always interpreted first.
- Double links are interpreted first also, except that middle delta instructions may set points that are linked by double links.
- Single links and interpolate commands are interpreted in logical sequence.
- Middle delta commands are interpreted after commands that set positions of the points for which they are set, but before commands that are based on these points.
- Final delta commands are interpreted after final interpolation of the untouched points.
To create and modify visual TrueType hints, select the glyph cell and choose the TrueType Hinting command from the Tools menu or click on the button in the Toolbar. Please see the TrueType Hinting tool for details on using it.
When you add a new Type 1 stem, it is added to both stem lists: Type 1 (editable with Font Info) and TrueType.
You can view and edit TrueType standard stems in the dialog hidden under the button in the TrueType Hinting tool’s local toolbar.
Like Type 1 standard stems, TrueType standard stems also have some additional properties. They may be named and their rounding may be specified for selected PPMs.
In FontLab you can control the rounding of the standard stem widths. You can set the PPM size at which any standard stem width is changed from 1 to 2 pixels, from 2 to 3 pixels, from 3 to 4 from 4 to 5 and from 5 to 6 pixels. We call these critical PPM sizes “jump” PPMs because here the stem width makes a jump from 1 to 2 pixels, from 2 to 3 pixels and so on up to 6 pixels wide. By default, standard stems are scaled linearly and are rounded to the closest integer value.
The TrueType stems dialog box consists of a toolbar on the top and a stem list in the form of the chart.
Buttons on the toolbar mean:
|Include vertical stems in the list (stems measured along the X axis)|
|Include horizontal stems in the list|
|Add new horizontal stem|
|Add new vertical stem|
|Remove the stem selected in the list|
|Optimize the rounding PPMs|
|Reset rounding PPMs to linear values|
|Automatically calculate stems|
Columns in the list of stems mean:
|Name||Name of the stem. The stem name appears when the stem is used in the hinting program. We do not recommend using long stem names, 6–8 characters is enough in most cases|
|Width||Width of the stem|
|2–6||PPMs at which the stem is scaled to 2–6 pixels|
|Tags||Stem tags assigned to stems|
To edit a value, simply double-click on it and edit right in the chart.
A yellow background in the list highlights vertical stems.
To add a new stem, just click on the or the button and a new stem will appear with the X or Y in name and a width of 100 or 50.
To remove a stem, select it in the list and click on the button.
Control over stem widths rounding is necessary for two reasons:
- To control a font’s contrast. If your font is low contrast, like Courier or Arial, you may want to set the jump PPMs for vertical and horizontal stems equal. This way, the font will never get high contrast, as when vertical stems are 2 pixels wide and horizontal stems are only 1 pixel wide.
- To synchronise the scaling of stems with close widths – like the stems that control straight and round vertical stems in uppercase characters. At large PPM sizes they should be different but they have to make the 1→2 and 2→3 width jumps together.
Bigger jump values are necessary when you are working on a black or extra black font where 5-pixel width stems appear at low PPMs.
To change stem rounding:
- Change the PPM sizes at which the stem that you want to edit makes its various jumps from one pixel up to 6 pixels.
- Press the button to automatically optimize the stem rounding while trying to keep optimal contrast. Use the button to reset all stem PPMs to linear values.
General Hinting Options»
Click on the button in the TrueType Hinting tool’s local toolbar and you will see a General Hinting Options dialog box:
Stem snap precision»
Measured in 1/16 of a pixel, this value defines the difference between the actual stem width (scaled but not rounded) and the stem width in pixels specified by the stems dialog box. If the difference is more than the defined value, the stem is rounded linearly. A value of 16/16 will mean that stem rounding will be controllable only when the difference is less than one pixel. A value of 32/16 defines a possible difference of 2 pixels.
No zone alignment above this PPM»
Enter the font size in PPM after which zone alignment will not be operative and all points controlled by the
AlignBottom commands will be rounded to closest pixel edge.
No hinting above this PPM»
Defines the PPM above which instructions will not be operative anymore. Enter 0 to never stop instructions.
Glyph waterfall PPMs»
The sizes for glyph waterfall preview at the top of the Glyph window
Text waterfall PPMs»
The sizes for text waterfall preview in the TrueType Hinting panel
The list of sample texts for TrueType Hinting panel
You may click Apply button to immediately see results of the new options in the TrueType Hinting panel.