Fix rendering library thumbnail if it has an Arabic name - #8050
Fix rendering library thumbnail if it has an Arabic name#8050hadicharara wants to merge 5 commits into
Conversation
Is this a Skia issue? |
Yes exactly! I had added a library that fixed this problem. Not sure if I should rebase though because of the lack of interest in this MR. |
|
Please rebase (and update added deps) |
903189a to
994e0aa
Compare
Considering this won't run often, I'm not sure if it's worth the performance improvement. However, if you insist, I'll look into it. Also, I just rebased and updated the dependencies. |
If my link works it should fix the image for all RTL languages, not just Arabic; so I think it should at least be tested |
|
Alright I didn't think about other languages. I'll test it and report back. |
|
I did it. It should work with all RTL languages. Result is still sub-par but better than before. |
|
I don't think this PR is entirely correct. Some of the values are outside char range. You need to convert them to utf32 like the SO post says |
|
Converted characters to UTF-32 now. |
|
Solved by #9612 |
Library thumbnail rendering were broken with Arabic names, due to a bug in the DrawText function of the canvas.

Example for the word أفلام:
Changes
I used CanvasExtensions.DrawShapedText to properly render Arabic fonts. However, this function does not consider TextAlign (and calculating text width for Arabic fonts is complicated). As such, I am only using it for Arabic library names, and have set a fixed position from the left for the library name.
Although not ideal, it is better than before. I am open to any feedback!