Created attachment 188849 [details] RTL formula Description: The formula is incorrectly displayed as RTL, and the parenthesizes are incorrectly reversed. Steps to Reproduce: 1. Open attachment Actual Results: The formula "f(x)" is incorrectly displayed as RTL, and the parenthesizes are incorrectly reversed and is displayed as "f)x(". Expected Results: The formula should not be displayed as RTL, and the parenthesizes should not be reversed. If you make the paragraph LTR, the formula is displayed correctly. Reproducible: Always User Profile Reset: No Additional Info: Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 4582cea56eedfe3529fe360c68fc4b95b7d47ac5 CPU threads: 12; OS: Linux 5.19; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded
Created attachment 188850 [details] A set of RTL formulas compared with LTR ones Compare the RTL formulas with the LTR formulas. The RTL formulas are garbled and rendered incorrectly.
The problem is twofold: 1. DOC file open, which leads to the above problem. The problem is not visible in DOCX. 2. When editing the formulas, changing direction should not have any effect (probably other than using localized numerals, if needed).
@Khaled: This can be an interesting piece of font rendering. :-)
Not reproducible in 3.3. Marking as regression. LibreOffice 3.3.0 OOO330m19 (Build:6) tag libreoffice-3.3.0.4
Bibisected to: commit 6b8c157a0b4f37a09fdbf656919b2df06a3abc3e Date: Thu Mar 4 15:35:44 2021 +0100 make RenderMaskPrimitive2DPixel() clip using clipping (tdf#140797) But I think it just changes the conditions that expose this bug. If I revert this commit, the issue is fixed unless the UI is RTL, then the issue shows up again. It is even worse with RTL UI, since the equation is always broken regardless of the paragraph direction. So I don't think it is a regression per se. 4.3 looks good with RTL UI, bibisecting again.
Bivisected with RTL UI to a271321ab7d66eab007f998237e7fb09dd5c9bf7, but this makes little sense and reverting this commit makes no difference.
FWIW, the formula is not imported as a Math formula, but as a vector image, so Formula Editor is probably not involved at all here.
I cannot reproduce this bug in the following versions, using either LTR or RTL UI: Version: 24.8.6.2 (X86_64) / LibreOffice Community Build ID: d50be90c1d90f0f90a5235ffcbbafbbfa38a83c2 CPU threads: 32; OS: Linux 6.11; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: bd427a7f1d6e854746b2151855923cb17405c6dd CPU threads: 32; OS: Linux 6.11; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded There have been a lot of recent fixes around RTL WMF/EMF, most notably bug 119785. It's likely that one or more of these changes fixed this bug.
For some reason, the formula is no longer editable for me. (Support dropped?) Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: fa3a64e14b49b8edcf5aacae98e9c18bd9e5ab27 CPU threads: 12; OS: Linux 6.2; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded That might be the reason why text direction has no effect on the formula anymore.