ericfreese/font-viewer

EOT font support

skyrpex opened this issue · 2 comments

Is there a reason not to support EOT fonts?

Regards,

The font-viewer package currently shows every available glyph in the selected font. To get a list of available glyphs, it uses the freetype2 module to parse the font file. The Freetype library doesn't support EOT files, so font-viewer doesn't either.

However, EOT files could be handled differently. We'd just need to find a way to retrieve a list of available characters.

Looking at the specification, the OpenType/TrueType font data is available at the end of the file, BUT in some files (I have no idea how many), it's compressed with a proprietary algorithm so that we can't decompress it. Files that are compressed have a TTEMBED_TTCOMPRESSED flag, so we could try detecting if that flag is set and opening the file if it's not.

So the end result would be that font-viewer could theoretically open uncompressed EOT files but not compressed ones.

Pull requests welcome ;) There's an eot-parser module that looks like it would be a decent starting point, but it doesn't currently load the processing flags or the font data.

More info:

Mind if I close this? I don't have the time to create a merge request...

Feel free to reopen this if you want.