-
Notifications
You must be signed in to change notification settings - Fork 43
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
Skparagraph binding #258
Skparagraph binding #258
Conversation
…ultFontManager methods
…nd current limitation with FontCollection
This includes underline and strikethrough text effects. Fixes kyamagu#224
…, since we cannot bitmask in python to get a valid c++ enum
Missing a lot of documentations and tests, but operational - in running that particular example. Since this is google's own example, we can at least hope that if they break it, they'll update the example and points towards a modification/update of the example code too. |
The skia-python example gives output which are pixels identical to the c++ example, if you take into account of how they load the same font differently. I haven't figured out how to use skparagraph with an exact font file, but that's a limitation of my python knowledge about sub-class'ing, rather than this pull. We might be able to get around it by adding a python |
Adapted from snipplet from skia's example/shape_text.cpp
…r.OneFontMgr() to it too
… -> canvaskit/0.38.2-6082-g07d7158eea
….38.2-6408-g0f81dc8b2e
Based on the just removed code in the "Remove SkColorFilter::filterColor" commit: google/skia@2727e4e This has been marked deprecated for some time, and all callers have migrated to filterColor4f. Milestone 130 ------------- * `SkColorFilter::filterColor` has been removed. Please use `SkColorFilter::filterColor4f` instead.
@kyamagu m130 is out, and it is quite small. I intend to pull #265 (and therefore also #260) and #256 into this, and do the README.m129 / m130 here (and mention this as a m130 change although it was post m128 against m128). Do you want to review this pre-pull of those, or post? Or doesn't matter? The pulls are all updating separate area of code, so it is fairly obvious which is which, even if I join all of them together before review. Still missing are some tests from this. Upstream hasn't changed much documentation wise. |
@HinTak It's good m130 update is small. At a glance, the code change looks good to me. It doesn't matter whether to review before or after the pull. Thanks! |
Okay, test_paragraph.py failed on windows. I suspect it is the icu code which isn't used on windows; so let's just skip it for windows and see whether test_unicode.py fails too. |
It appears that on windows, icudtl.dat needs to be copied to a load path. There are fairly recent reports about using skparagraph on windows (with rust or c#, or just c) that needs this. |
Apparently the canonical place to get icudtl.dat is from ihttps://github.com/unicode-org/icu/releases , one of the data-bin-{l,b}.zip files. L/B for little / big endian, and it is versioned. |
…icodes tests on windows for the moment.
Okay, the failure on test_unicode.py is clearer - it just fails to construct. This looks to be a generic skia problem and has been reported against other users of skparagraph on windows quite recently (flutter, rust-skia, skia-sharp), and they seems to suggest people to get the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Mac os intel: |
Binding skparagraph and adding text decoration.
Fixes #225 and #224
@kyamagu this is operational in running
https://github.com/HinTak/skia-python-examples/blob/main/shape_text.py
which is a python port of upstream's
https://github.com/google/skia/blob/main/example/external_client/src/shape_text.cpp
Transplanted to build standalone against libskia as a shared library in
https://github.com/HinTak/skia-c-examples/blob/main/shape_text.cpp
Important note:
https://issues.skia.org/358587937
and its windows equivalent
https://issues.skia.org/307357528
And other issues in
https://github.com/HinTak/skia-building-fun/blob/main/ReportedIssues.md