Bug 128295 - PDF export regression in mixed LTR-RTL context
Summary: PDF export regression in mixed LTR-RTL context
Status: RESOLVED DUPLICATE of bug 115967
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: All All
: medium normal
Assignee: Not Assigned
Keywords: bibisected, bisected, regression
Depends on:
Reported: 2019-10-21 12:12 UTC by ajlittoz
Modified: 2019-10-21 13:04 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:
Regression By:

Arabic text with formula objects (121.61 KB, application/vnd.oasis.opendocument.text)
2019-10-21 12:12 UTC, ajlittoz
PDF of odt attachment (121.61 KB, application/vnd.oasis.opendocument.text)
2019-10-21 12:13 UTC, ajlittoz

Note You need to log in before you can comment on or make changes to this bug.
Description ajlittoz 2019-10-21 12:12:04 UTC
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.
Comment 1 ajlittoz 2019-10-21 12:13:32 UTC
Created attachment 155194 [details]
PDF of odt attachment

Export of original .odt document
Comment 2 ajlittoz 2019-10-21 12:33:13 UTC
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.
Comment 3 Xisco Faulí 2019-10-21 13:04:39 UTC
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 ***