8000 [feaLib] Correctly handle <NULL> in single pos lookups by khaledhosny · Pull Request #3803 · fonttools/fonttools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[feaLib] Correctly handle <NULL> in single pos lookups #3803

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

Merged
merged 2 commits into from
Apr 23, 2025

Conversation

khaledhosny
Copy link
Collaborator
  • Serializing <NULL> in single pos statements was broken (it was skipped resulting in invalid feature code).
  • Building such lookups was broken as well.

AFDKO’s makeotf does not support <NULL> at all, but we support it in pair pos lookups, so this is not much different. It might not be of much value, but it is something OpenType layout supports and it is causing round tripping issue for some code I’m working on.

bool(ValueRecord()) evaluates to False, which means "pos foo <NULL>;"
gets serialized to "pos foo ;" which is invalid.
This was causing an AssertionError:

File "/fonttools/Lib/fontTools/otlLib/builder.py", line 1528, in can_add
    assert isinstance(value, ValueRecord)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
@khaledhosny khaledhosny force-pushed the fealib-single-pos-NULL branch from e4eda5f to a64468a Compare April 23, 2025 13:04
@khaledhosny khaledhosny merged commit 86cb7ce into main Apr 23, 2025
1 check passed
@khaledhosny khaledhosny deleted the fealib-single-pos-NULL branch April 23, 2025 13:06
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
0