Skip to content

Conversation

@smasty
Copy link

@smasty smasty commented Mar 31, 2022

Hi, according to the WOFF File Format 1.0 and WOFF File Format 2.0 specifications,

Although only fonts of type 0x00010000 [...] and 0x4F54544F [...] are widely supported at present, it is not an error in the WOFF file if the flavor field contains a different value, indicating a WOFF-packaged version of a different sfnt flavor. [...] 0x74727565 has been used for some TrueType-flavored fonts on Mac OS.

In the current state, this library only checks for the TrueType flavor (0x00010000), but OpenType flavor (0x4F54544F) fonts are common as well, and those are not correctly identified by this library.

As an alternative to #117, if you're not comfortable with allowing arbitrary flavors, I'm proposing implementing support for the three flavors mentioned in the specification itself: 0x00010000 (already present), 0x4F54544F and 0x74727565.

@smasty smasty changed the title Add support for more WOFF/WOFF2 flavors Add support for more WOFF/WOFF2 flavors (Alternative to #117) Mar 31, 2022
@h2non h2non merged commit c993057 into h2non:master Apr 19, 2022
@h2non
Copy link
Owner

h2non commented Apr 19, 2022

A new version is available on PyPI. Upgrade it by running: pip install --upgrade filetype

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants