CodeZombie / TypeRip

Adobe Fonts (formerly TypeKit) font ripper
http://badnoise.net/TypeRip/
387 stars 65 forks source link

Unable to convert downloaded woff2 files #3

Closed ablakers closed 6 years ago

ablakers commented 6 years ago

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.

CodeZombie commented 6 years ago

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!

ablakers commented 6 years ago

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.

CodeZombie commented 5 years ago

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.