Postscript originally required that hints should not overlap. Now it requires that any active set of hints be non-overlapping, but it allows you to change sets as you move through the character.
So to implement hinting with hint substitution PfaEdit needs to know not only the position and width of the stem being hinted, but also where the stem should be active. And it needs to know what stems overlap which other stems.
The horizontal stems are drawn in light green. The vertical stems are drawn in light blue. The areas where the stems are active are filled in as rectangles, outside of that area the stems' outlines are drawn with dotted lines. Most of these stems do not conflict with any other stems, but two, the bottom two horizontal stems conflict with each other. All the non-overlapping stem hints may be active at the same time, but only one of the two conflicting stem hints may be active. As PfaEdit outputs the character it decides at each point what stems need to be active, and activates them.
Postscript now allows PfaEdit to control relative counter sizes. Counters are the spaces between adjacent stems. In the example at left there are two counters of equal sizes between the horizontal stems on the left, and three counters of equal sizes on the right. These form two independent counter groups, and PfaEdit's Hints->Auto Counter command will generate a counter description for each of them. You may also control the counters directly by using the Counters pane of the Element->Char Info dialog.
Counters spaces appear between vertical stems too, and in this case Pfaedit would output one counter group for the vertical stems.
One of the major advantages of hint substitution is that it allows certain standard serif situations to be described. In the example at right, the serif one the left is smaller than the stem a bit further right.
But it doesn't solve all problems (or I don't know how to use it to do so). Consider the serif on the right. Hint substitution would allow us to define a hint for the main vertical stem and for the short vertical stem that corresponds to the serif. But the problem that needs to be solved is making the distance between the left edge of the serif and the left edge of the stem be the same as the distance between the right edge of the stem and the right edge of the serif. But doing so would require overlapping hints, active at the same time. I think
PfaEdit's AutoHint command can be used to figure out horizontal and vertical stem hints. It will also find hint substitution points (if any are needed), and will check for the simple counter description allowed by OpenType for non-Asian fonts (the equivalent of h/vstem3 hints in type1 fonts).
Whenever you change a character PfaEdit keeps track of that fact that the hints are out of date (when you autohint a character, or make a manual change to the hints PfaEdit resets this flag). If you generate a postscript font from something that contains glyphs with out of date hints, then PfaEdit will automagically regenerate them.
This may not always be appropriate. You can turn this off in general with the HintForGen preference item. You may turn it off for an individual character with the Hints->Don't AutoHint command.
I hope that the PfaEdit's autohint command will be good enough that manual efforts will not be needed. But hopes like this are rarely fulfilled.
The AutoHint command should find all stems in a character. Some of them it deems to be useless and will remove them. If you find that PfaEdit is removing a hint that you think is important then invoke Hint->AutoHint with the shift key held down, this will tell PfaEdit not to prune any of the stems. You may then use Review Hints to prune things yourself.
If you find that you must create your own hints, PfaEdit will only allow you to specify the position and width of the hint, it will then go off and try to guess the extents where the hint should be active.
You may manually:
Once you have made a manual change to a character's hints with any of the above commands, that character will be marked "Don't AutoHint" until you explicitly call the AutoHint command on it. You may also explicitly use the Hints->Don't AutoHint command to turn off PfaEdit's automatic hinting attempts.
You may also manually
These do not set the "Don't AutoHint" bit.
PfaEdit's Hints->Hint Substitution Pts command will automatically figure out where hint substitution should occur, but if this isn't good enough you may do it manually with the Element->Get Info command (when the selection is a single point to which you want to attach a hintmask).
If a glyph has conflicting hints then the first point in the glyph (the first point on the first contour) MUST have a hintmask attached to it. If it does not, the PfaEdit will automatically figure substitution points when it generates the font. Other points are not required (but may) have a hintmask.
The hintmask specifies what hints should be active when that point is positioned, and will control all subsiquent points until a new hintmask is established. So in the following example, the selected point (on left) has the highlit hints active at it, In the character view the currently active stems are drawn much darker than the inactive ones. Points with hintmasks attached to them have circles drawn arround them.
Remember to hold the control key down when making disjoint
PfaEdit also has a Hints->Auto Counter command which tries to figure out what stems form a counter group.
Again you can do this manually, with the Counter pane of the Element->Char Info dialog. When creating a new counter group you are presented with a dialog very similar to the one above in which you must select a set of hints that bound a set of counters.
PfaEdit will not be able to convert TrueType instructions into PostScript hints when it reads a TrueType font (the format is too complex, there are too many posibilities, instead PfaEdit stores all the truetype instructions and writes them back out uninterpretted).
From a Type1 font it will happily read all the hints in a character, and keep track of hint substitution points. It will not read counter hints though.
In an OpenType (Type2) font PfaEdit will read in all the hints, keep track of hint substitution points and the counter hints.
PfaEdit does a really bad job of "hinting" (actually generating instructions for) truetype. Generally you will get better results with unhinted characters than with characters autoinstructed by pfaedit.
Hinting TrueType fonts opens a far wider range of posibilities. I have added several types of hints that are specific to truetype (and will be ignored by the postscript generation routines). These by no means exhaust the capabilities of TrueType.
A fully hinted glyph is
completely grid fit, but
the difference between
stem lengths is lost.
One attempt to solve the
above problem, compare
Note how the different
directions in the md hint
change the rasterization
I find the hint documentation inadequate for me to do a good job at hinting.
Overview of Hinting in Postscript and