Typophile

Copying Figure Kerning Information

Robby Woodard

I am editing an existing font family that had proportional old style figures as the default and a feature for tabular lining. My client wants those switched so that tabular lining is the default and proportional old style the feature.

Seems simple… I set up a new encoding file with figure.oldstyle replacing the old figure.lnum glyphs and, copied the glyphs into the new locations and set up the features to work properly.

That just leaves the kerning… right now I am laboriously copying the kerning info onto paper, deleting it all then carefully inputting it all back into the new old style glyphs. It seems like this approach will take forever with 16 individual fonts and is prone to accidental mistakes.

I couldn't get "Paste Special" to work as all the figures have new names. Can you guys think of an easier way to handle this kerning problem?

If you are using FontLab:

Export the AFM Metrics file.
Open it in a text editor.
In the 'Kerns' section rename the glyphs in turn (e.g. one to one.oldstyle) with Find & Replace and save as a new file with the AFM extension.
Back in FontLab, delete all the kerning, move the figures into the correct encoding slots .
Open a Metrics window and open the new AFM file.
Select 'Import kerning data into current font.

That is brilliant, Malcolm! I have worked with Fontlab for a few years and never thought to try editing amf files with a text editor. This bit of information will come in very handy down the road.

Thanks!

As brilliant as it sounded, I can not get this process to work.

I have edited the old afm file in Word and TextEdit (mac). I just changed all the figure names from zero to zero.oldstyle throughout. The new font has all the figures in position and renamed in the encoding file.

When I import the new afm back into the new font with the new figure names, it only applies changes to glyphs that were in the original font. Any glyph with a new name get no new kerning.

Any ideas on what might be happening?

It was great to learn I can edit .afm in a text editor. Disappointing that search and replace would not work as described…

I think it had something to do with the new figures being in the wrong order after their names were changed. The Update [kern] feature would not reorder them properly to work either.

The most streamlined workflow I could figure out was to export the old .afm, open it in a text editor and do searches for the figures. As I found them, I cut them from the old .afm and pasted them into a new blank doc.

I imported the .afm, now with no figure info, into my new .vfb with the new the figures with new names and positions.

Using the new text file with all figure info, I copied and pasted the data into the new figures by hand.

A little tedious but it worked. I am still thinking there is probably a better way...

I do quite a bit of website coding that often involves conditional search and replace patterns that extend over hundreds of documents. For these kinds of complex changes to text, learning Regular Expressions can literally save thousands of hours of manual deletes, copying, pasting, reordering and adding things. Combine it with a scripting language, like Perl or, even, Applescript and magical sorts of mass changes can be done. The big drawback, of course, is the learning curve, which probably wouldn't be cost-effective for a one-off juggling of text in a few .afm files.

Captured from web.archive.org on 17 Mar 2015. view this capture