Programmatically building an encoding for Fontlab

butterick's picture

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.

butterick's picture

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

Syndicate content Syndicate content