friction2d / friction

Friction Graphics
https://friction.graphics
GNU General Public License v3.0
183 stars 10 forks source link

Problem with unicode languages #118

Open axiomgraph opened 4 months ago

axiomgraph commented 4 months ago

Unicode languages show improperly. Screenshot from 2024-02-09 14-00-47 Well, it can be fixed by enabling RTL language support in preferences. But the language I used, "Malayalam," is not a right-to-left language. Screenshot from 2024-02-09 14-00-19 Even if that solves the issue, you cannot use text effects. which again starts showing words improperly. Screenshot from 2024-02-09 14-07-27

rodlie commented 4 months ago

Hi,

Is there some documentation somewhere regarding this? I need to know if this is something that should be handled in Friction or skia (the backend that handles text etc). Or examples from other applications that does this correctly.

axiomgraph commented 4 months ago

Here is the same text in Gimp and Inkscape using the font Noto sans Malayalam. Screenshot from 2024-02-11 16-57-55 Screenshot from 2024-02-11 16-59-50

rodlie commented 4 months ago

I'm able to replicate the issue.

About "RTL" in Friction:

The "RTL option" bypasses the skia text engine during "text to path" and uses Qt to create the path and then converts it to a native skia path.

This kind of works, as what you see is correct, but internally it's still wrong. And as you notice one issues with this is that text effects will not work, as they operate on the actual text, not the final path.

So, currently I'm unable to fix this issue.