skia-python m130 is out. New to this new release is the binding to upstream's 
multi-line multilingual skparagraph module, for multi-line text layout. During 
the final testing stage, it is found that it doesn't work on windows; recent 
reports of other skia-derivatives (rust-skia, skia java, and upstream skia c 
discussions) seems to indicate that, for windows users, they need to copy 
icudtl.dat from somewhere else to the search/load path for skparagraph 
functionality to work. If some windows python users could give this a try and 
report, that would be useful. Linux and Mac users, enjoy the new functionality.

More details below, and at the release notes at 
https://github.com/kyamagu/skia-python/ .
     On Wednesday 14 August 2024 at 20:05:35 BST, Hin-Tak Leung 
<ht...@users.sourceforge.net> wrote:  
 
  There was a recent enquiry about the availability of skia's skparagraph 
functionality in skia-python, so I did some digging and added that to the next 
skia-python release. (m129/130 in about two months' time, when skia m130 get 
forked by google).

For those who doesn't know what it is (that includes me two weeks ago...), 
skia's skparagraph offers multi-line text layout, with a variety of alignment 
options (left/right, centered, justified), and decorations 
(underline/strikethrough). I guess that functionality is probably somewhat 
equivalent to pango's role. Skia's skparagraph is based on freetype/harfbuzz so 
can mostly "do the right thing" with the middle-eastern languages on 
line-breaks, etc. Have a try with Arabic / Hebrew etc if you feel like it. I 
did.

This is mostly a RFC / request for testers etc. The main info and source code 
is at https://github.com/kyamagu/skia-python/pull/258 , and example program at 
https://github.com/HinTak/skia-python-examples/blob/main/shape_text.py . 
Prebuilt python wheels is at 
https://github.com/kyamagu/skia-python/actions/runs/10355210169 for the three 
major platforms, linux, windows, mac os x.

The quickest way for people to try it out is simply download one of the 
relevant wheels, install it, and play with the example. (edit it with your own 
text for rendering, setting various options, then run "shape_text.py 
chosen-font.ttf output.png").

Note that most of the problems with documentations, and additional functions, 
neither https://github.com/kyamagu/skia-python/ nor 
https://github.com/HinTak/skia-python-examples/ is the correct place: see 
https://issues.skia.org/358587937 and https://issues.skia.org/307357528 - we 
basically replicate upstream's API / documentations, so it needs to be in 
Google's skia repo first.

Thanks for reading so far.    

Reply via email to