Typophile

Programmatically building an encoding for Fontlab

butterick

Is there a stable, recommended way of programmatically creating an encoding within Fontlab? That is, instead of loading from an .enc file using encoding.Load(encodingFile), I want to build up the EncodingRecords from various parameters.

Allegedly, the font object contains an encoding object that is a list of EncodingRecords. I've been able to read out the values from an existing encoding but not write them (horrible crashes typically ensue).

The Fontlab python reference is somewhat mysterious on these points.

Obviously, I could work around this by creating an enc file programatically, saving it in a temp location, and then passing that to encoding.Load(). Maybe that is the preferred method, rather than mucking around with lists of EncodingRecords.

Ignore. Creating a temp encoding file and then loading it back in works fine.

Captured from web.archive.org on 14 Oct 2013. view this capture