Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmap format 4 subtable length check is too strict #89

Open
mikeday opened this issue Apr 27, 2023 · 1 comment
Open

Cmap format 4 subtable length check is too strict #89

mikeday opened this issue Apr 27, 2023 · 1 comment

Comments

@mikeday
Copy link
Contributor

mikeday commented Apr 27, 2023

The cmap format 4 subtable ends with an array of unspecified length, and Allsorts determines its length by checking the length field for the subtable given earlier. This should always be even given that the subtable only contains u16 values, however we have encountered fonts in the wild for which it is odd -- Allsorts will refuse to process them while other implementations will accept them.

I think we need to just round down the length here, and potentially log a warning if warnings are enabled, rather than refusing to process the subtable. (Any other similar length checks may also require scrutiny).

@mikeday
Copy link
Contributor Author

mikeday commented Apr 27, 2023

Font encountered here:

terrastruct/d2#1252

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

No branches or pull requests

1 participant