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

Bind hb-paint API #185

Merged
merged 10 commits into from
Feb 3, 2024
Merged

Bind hb-paint API #185

merged 10 commits into from
Feb 3, 2024

Conversation

khaledhosny
Copy link
Collaborator

No description provided.

@behdad
Copy link
Member

behdad commented Jan 23, 2024

Nice. Thanks.

@khaledhosny khaledhosny force-pushed the hb-paint branch 4 times, most recently from 7d5e986 to 500c5f2 Compare January 27, 2024 19:25
@khaledhosny khaledhosny marked this pull request as ready for review January 27, 2024 19:27
@khaledhosny khaledhosny force-pushed the hb-paint branch 2 times, most recently from 9f95ace to fafa235 Compare January 27, 2024 20:00
@khaledhosny
Copy link
Collaborator Author

I’m starting to think the PyCapsule stuff is not of much use here, since the C side would need to link to HarfBuzz to be able to access the various C objects (hb_font_t, hb_blob_t, hb_color_line_t, and so on). So I think I’m going to rip it away.

The test failure is something I don’t understand. It seems that calling PaintFuncs.set_color_glyph_func() Somehow results in the color_glyph function being set to the push_clip_glyph function. There is probably some bug in my code, but I lost countless hours trying to find it in vain, that or I’m hitting some mysterious cython/python bug.

Tests in the next commit.
Test fonts and expected results are taking verbatim from HarfBuzz tests.
It does not seem to be of much use since the C callback functions need
to link yo HarfBuzz to use its API to access various HarfBuzz objects.
For whatever reason, passing the individual functions as user_data
results in a mixup between paint_color_glyph_func and
push_clip_glyph_func. Passing the while PainFuncs instance instead seems
to workaround this.
Coerces it to Python bool
@behdad
Copy link
Member

behdad commented Feb 2, 2024

The test failure is something I don’t understand. It seems that calling PaintFuncs.set_color_glyph_func() Somehow results in the color_glyph function being set to the push_clip_glyph function. There is probably some bug in my code, but I lost countless hours trying to find it in vain, that or I’m hitting some mysterious cython/python bug.

Did you figure this out?

@khaledhosny
Copy link
Collaborator Author

The test failure is something I don’t understand. It seems that calling PaintFuncs.set_color_glyph_func() Somehow results in the color_glyph function being set to the push_clip_glyph function. There is probably some bug in my code, but I lost countless hours trying to find it in vain, that or I’m hitting some mysterious cython/python bug.

Did you figure this out?

No, but I did something different. I was passing the functions as user_data, but now I pass the PaintFuncs instance and access the functions from there.

@khaledhosny khaledhosny merged commit 737ff7c into main Feb 3, 2024
4 checks passed
@khaledhosny khaledhosny deleted the hb-paint branch February 3, 2024 07:31
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