CodeZombie/TypeRip

Unable to convert downloaded woff2 files

Closed this issue · 3 comments

I wanted to install some fonts on my PC and woff2 fonts need to be converted before you can install them on Windows, but although the grabbed fonts display fine on the page and in the Application tab of Chrome dev tools I have been unable to convert them to TTF or OTF. I tried various online font converters and built woff2 from source but although they have been able to convert woff2 files from other sources they all failed to convert these ripped woff2 files.

The problem was the tool was always downloading fonts as WOFF2, even though the files are sometimes OTF.

The tool now detects the file type and downloads with the correct filetype.

This has surfaced another problem however, being that Windows, and potentially other operating systems, don't always parse the OTF files correctly. This is fixed by running the downloaded font through a font-conversion tool, namely https://transfonter.org/.

Ideally the tool would do this automatically, but I'd have to find and integrate a javascript-based font conversion library. Opentype.js looks like it will work, but it might be a while before I'm able to integrate and test it properly.

Thanks for raising the issue!

Thanks! I guessed that they might not really be woff2, but the parsing issue must have been why renaming didn't work. Any convenient way to stop the fonts being renamed to long hexadecimal numbers when run through the converter? I ran the same font through various online converters and it got renamed the same way each time, I think it's how they are named on the site for obfuscation.

Doing that will require decoding and re-encoding the font file using a Javascript font library. I've been trying to find workarounds to easily change the name, because yeah, that's the most annoying problem with the project as of right now, but it doesn't look like it's safe to do it that way.