Created attachment 111507 [details] Krita displaying Arabic text and the exclamation mark is on the right instead of left This was reported[1] first in Phabricator. I was testing one of the last nightly (or beta) builds and found out that the direction of Arabic text is LTR. The special SVG "direction"[2] property is needed for the direction to be applied. Sample text used (Don't care about the wrongness in the web browsers, they can't handle both directions): كريتا هو برنامج للرسم الرقمي! Krita is a digital painting tool! 1: https://phabricator.kde.org/T8198 2: https://svgwg.org/svg2-draft/text.html#DirectionProperty
Created attachment 111508 [details] Krita displaying Arabic and English texts, and the exclamation mark is on the right side of the Arabic sentence instead of left
Thanks for reporting. I suspect the property just isn't converted at all when doing from qdocument to svg.
Dmitry, can you take a look?
Git commit a7c8affee3437ea80c27ec6f3670044ce788b250 by Dmitry Kazakov. Committed on 21/03/2018 at 19:27. Pushed by dkazakov into branch 'master'. Implement automatic 'rtl' tag for arabic text pasted in the text editor Thanks samirosman for his consultations on the topic of Arabic languages! :) M +26 -2 libs/flake/text/KoSvgTextShapeMarkupConverter.cpp https://commits.kde.org/krita/a7c8affee3437ea80c27ec6f3670044ce788b250
Thanks a lot Dmitry! I was wondering why we don't use just http://doc.qt.io/qt-5/qstring.html#isRightToLeft... Or even http://doc.qt.io/qt-5/qtextblock.html#textDirection :)
Git commit a3ca8183306a6436dbfb6d622c6f65241bb7cf39 by Boudewijn Rempt, on behalf of Dmitry Kazakov. Committed on 03/04/2018 at 11:15. Pushed by rempt into branch 'krita/4.0'. Implement automatic 'rtl' tag for arabic text pasted in the text editor Thanks samirosman for his consultations on the topic of Arabic languages! :) (cherry picked from commit a7c8affee3437ea80c27ec6f3670044ce788b250) M +26 -2 libs/flake/text/KoSvgTextShapeMarkupConverter.cpp https://commits.kde.org/krita/a3ca8183306a6436dbfb6d622c6f65241bb7cf39
I'm still wondering about why not using the direction detect function of QString/QTextBlock, by the way :)
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1859
Git commit 40c638f2ca312a50186698b65622a17579db7b54 by Alvin Wong. Committed on 19/07/2023 at 09:20. Pushed by dkazakov into branch 'master'. flake: Use more reliable way to check RTL from QTextDoc Use the text direction given by QTextBlock directly instead of reinventing the RTL detection. The old check is still kept as a backup, but probably won't be called. M +35 -19 libs/flake/text/KoSvgTextShapeMarkupConverter.cpp https://invent.kde.org/graphics/krita/-/commit/40c638f2ca312a50186698b65622a17579db7b54