Fix RTL text with format incorrectly shaped
This fix is a work around the bug in Qt. Ideally it should be fixed there but we can do what is possible here.
The problem is mentioned in details in the comments of this script. Short version is that Qt's text shaping code is naive. It breaks the text into boundaries which make no sense and this leads to bad results.
We can also fix this for Foreground text/Underlines etc but lets see if we get a bug for that first.