You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, code that checks the magic number at the beginning of the file will return BadVersion if the magic number is unexpected for the current method, but what's actually expected depends on the context.
In some cases, the code requires TTF, in others it requires WOFF, and in others it accepts both but will still throw a BadVersion error if the file is something else entirely.
I would recommend converting this error into a WrongFormat error, which contains a field describing what kind of format was detected, if one exists. I would expect this to detect TTF, WOFF/WOFF2, and OTF, and have "unknown" for anything else.
"Unexpected version" implies that there are other versions, but this is kind of misleading, since TTF is always version 1, and if you get something like 0x4F54 you can be relatively certain this is just an OTF font and not TTF version 20308.
The text was updated successfully, but these errors were encountered:
Right now, code that checks the magic number at the beginning of the file will return
BadVersion
if the magic number is unexpected for the current method, but what's actually expected depends on the context.In some cases, the code requires TTF, in others it requires WOFF, and in others it accepts both but will still throw a
BadVersion
error if the file is something else entirely.I would recommend converting this error into a
WrongFormat
error, which contains a field describing what kind of format was detected, if one exists. I would expect this to detect TTF, WOFF/WOFF2, and OTF, and have "unknown" for anything else."Unexpected version" implies that there are other versions, but this is kind of misleading, since TTF is always version 1, and if you get something like 0x4F54 you can be relatively certain this is just an OTF font and not TTF version 20308.
The text was updated successfully, but these errors were encountered: