Created attachment 155193 [details]
Arabic text with formula objects
I am relaying this bug on behalf of a new LO user. Origin: a question on the French leg of ask.libreoffice.org at https://ask.libreoffice.org/fr/question/213665/pourquoi-les-caractere-francais-sont-ils-illisibles-dans-fichier-bilingue-ar-fr-pdf-exporte-par-libreoffice/
Document is written in Arabic with simple formulas created in Math. Since the formulas are really simple, they have just as well be typed and formatted directly in Writer.
Math formulas can be considered written in a LTR script. However, they are graphic objects (SVG) inserted "As character" in text flow. Since they are graphic objects, they should not be tweaked in any way by text formatting.
Everything is as expected on screen. But when trying to print or export as PDF, the formulas get mangled, e.g. if parentheses enclose a list like (x, y, z), the list gets printed as )x, y, z( with Latin letters shifted horizontally rather randomly (no even spacing).
Print and export to PDF are basically the same since, by default, Writer sends PDF to the printer. However, there is no workaround because Writer refuses to honor a request to change to PostScript (the selection is silently accepted after OK but reopening properties shows PDF again) and print-to-file hopelessly produces a PDF file and never a .ps file.
It looks as if the PDF export filter entered the SVG and merged it into the Arabic text and applied some dubious formatting rules.
I tried to print with obsolete versions (4.5 and 5.x) and these old versions exported correctly the text.
In the attached file, I added an equivalent of the formula object as standard text (sequence in red on first line) and this sequence is correctly exported.
Created attachment 155194 [details]
PDF of odt attachment
Export of original .odt document
Update to bug report
I printed-to-file in .ps format and the bad formatting is also present. Though I have no idea about the print engine, I suspect that PostScript and PDF use the same software piece since both languages are rather close relatives.
Regression introduced by https://cgit.freedesktop.org/libreoffice/core/commit/?id=302af8c2da58719844d22483b65a9fe5b3674684, which is the same as in bug 115967
*** This bug has been marked as a duplicate of bug 115967 ***