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

[cff] correctly parse negative operands, but don't allow -ve offset #270

Merged
merged 2 commits into from
Dec 28, 2023

Conversation

jfkthame
Copy link
Collaborator

This is @nagyatosz's patch from #269, plus a change to explicitly reject negative offsets. Although the spec does not seem to prohibit them, support in implementations is patchy, and AFAIK no mainstream tool or workflow will generate such a font. So it seems safer to reject them than to allow such an untested niche feature that implementations may mishandle.

@khaledhosny WDYT of doing something like this? We could reconsider if there's evidence of a real-world need to support this, though discussion indicated that not all engines would actually work with such a font.

nagyatosz and others added 2 commits December 13, 2023 10:44
Cff specification defines the operands as signed (not unsigned) integers.
This commit allows to keep the right signed value after corret parsing of negative integer values.
Copy link
Owner

@khaledhosny khaledhosny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can add some test fonts that would be nice, otherwise LGTM.

@khaledhosny khaledhosny linked an issue Dec 15, 2023 that may be closed by this pull request
@khaledhosny khaledhosny merged commit c938269 into khaledhosny:main Dec 28, 2023
5 checks passed
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.

Cff Font Dict operand types - unsigned integers vs. signed integers
3 participants