Implementing AFDKO 'makeotf' CLI program for woff2?

315 views Asked by At

I've mastered command-line font conversion to and from all the main formats in use these days with one exception. Certain woff2 files just wont decompress using the official tools on GitHub. I know they are not corrupt and I know the file-type is correct. I had the same problems when trying some of the top commercial converters, as well as many free online utilities. For some reason, the only one that works with these problematic woff2 files is EverythingFonts. My best guess WHY is that perhaps some woff2 fonts may employ experimental bleeding-edge features that aren't compatible with the stable public decoders currently available on GitHub.

The metadata in output indicates the conversion makes use of the "AFDKO" package of command-line tools (Adobe's Font Development Kit for Opentype), which are also available for free on GitHub or Adobe's site.

I dislike the online converters because most impose size restrictions, limit the number of conversions, and only convert a single file at a time. Plus I'm not always online. So, to clarify, my foremost question is:

What is the proper command and syntax to use when trying to input a woff2 file and output a ttf or otf file, using the makeotf binary within AFDKO? I'm open to answers that don't require this Adobe kit, if anyone has suggestions that I haven't tried.

My goal is to write a script that will automate batch-conversion, as I have for other font formats. Once that is achieved I plan on sharing my work with the world and launch an online font-info and conversion site free to all, without limitations. My server is Linux based if anyone has input toward that end. I'll also make the offline binaries available for free, but that will take time.

1

There are 1 answers

0
Mike 'Pomax' Kamermans On

If all you need is conversion to/from specific formats, the first port of call is TTX, a Python-based utility found over on https://github.com/fonttools/fonttools (note: it will need the brotli package installed separately if you're going to work with WOFF2 files).

It also comes with better error reporting than the AFDKO command line utilities, so that if things still don't work, you'll know where in the parsing of the font things go wrong.