Bug 92091 - Mis-rendering of Persian text with interspersed references to English footnotes
Summary: Mis-rendering of Persian text with interspersed references to English footnotes
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.8.2 release
Hardware: x86 (IA32) All
: medium normal
Assignee: Jonathan Clark
URL:
Whiteboard: target:25.2.0 target:24.8.0.0.beta2
Keywords: filter:docx
: 138199 146713 150286 (view as bug list)
Depends on:
Blocks: Font-Rendering Arabic-and-Farsi RTL
  Show dependency treegraph
 
Reported: 2015-06-15 18:43 UTC by Arham Amouei
Modified: 2024-08-04 21:30 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
contains a sample .docx file, a snapshot of ill-rendered text, and a snapshot of well-rendered text (117.12 KB, application/zip)
2015-06-15 18:43 UTC, Arham Amouei
Details
Reduced and annotated testcase (17.08 KB, application/vnd.oasis.opendocument.text)
2024-06-14 14:05 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arham Amouei 2015-06-15 18:43:13 UTC
Created attachment 116563 [details]
contains a sample .docx file, a snapshot of ill-rendered text, and a snapshot of well-rendered text

When I open some .docx files containing Persian text, the text is rendered badly. Interestingly, when I right-click on one the words that are not included in the Dictionary, and select Ignore All, then the text will be displayed correctly.

The .zip file that is attached contains a sample .docx file, a snapshot of ill-rendered text, and a snapshot of well-rendered text.
Comment 1 Buovjaga 2015-06-17 07:20:33 UTC
What I see matches the wrong.png, so setting to NEW.

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: 80ec99db4325a439a8a3f1d420d0a80f8bf9c439
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-06-16_00:00:20
Locale: fi-FI (fi_FI)
Comment 2 QA Administrators 2016-09-20 10:02:14 UTC Comment hidden (obsolete)
Comment 3 Arham Amouei 2016-10-18 14:26:39 UTC
Exactly the same behaviour is observed in LibreOffice 5.1.4.2 on Ubuntu 16.04
Comment 4 Arham Amouei 2016-10-18 17:34:04 UTC
Also it appears in LibreOffice 5.2.2.2 on Ubuntu 16.04 64bit
Comment 5 Arham Amouei 2017-01-29 08:49:46 UTC
I have noticed that this problem DOES NOT occur when there is no footnotes in Persian text.
Comment 6 QA Administrators 2018-01-30 03:44:06 UTC Comment hidden (obsolete)
Comment 7 Arham Amouei 2018-01-30 14:30:26 UTC
The bug is present on LibreOffice with following details:

Version: 5.4.3.2
Build ID: 92a7159f7e4af62137622921e809f8546db437e5
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk2; 
Locale: en-US (en_US.UTF-8); Calc: group
Comment 8 QA Administrators 2019-01-31 03:48:15 UTC Comment hidden (obsolete)
Comment 9 Roman Kuznetsov 2020-03-02 13:54:42 UTC
still repro in

Версия: 7.0.0.0.alpha0+ (x64)
ID сборки: 41177730421f9be9ad955766a5a19667d8003b11
Потоков ЦП: 4; ОС: Windows 10.0 Build 18362; Отрисовка ИП: по умолчанию; VCL: win; 
Локаль: ru-RU (ru_RU); Язык интерфейса: ru-RU
Calc: threaded
Comment 10 QA Administrators 2022-03-03 03:40:17 UTC Comment hidden (obsolete)
Comment 11 QA Administrators 2024-03-03 03:15:12 UTC Comment hidden (obsolete)
Comment 12 Sophie Sipasseuth 2024-03-06 14:50:54 UTC
Repro with this version of LibreOffice:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: fc9c15ec702d8a06e8747ee5b858751e5a90e30a
CPU threads: 8; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: en-US
Calc: threaded
Comment 13 Jonathan Clark 2024-06-13 11:58:29 UTC
The root cause of this bug is Writer failing to restore some global state when recursively building footnote portions.

The bug manifests in this document because the footnotes are in English. When the document is loaded, the first portion of Persian text is laid out correctly, but the ComplexTextLayoutFlags are cleared when laying out the first footnote. The next section of Persian text is then measured as if it were LTR, which breaks shaping and makes Writer think the text is shorter than it actually is.
Comment 14 Jonathan Clark 2024-06-14 12:37:54 UTC
*** Bug 150286 has been marked as a duplicate of this bug. ***
Comment 15 Jonathan Clark 2024-06-14 12:38:18 UTC
*** Bug 146713 has been marked as a duplicate of this bug. ***
Comment 16 Jonathan Clark 2024-06-14 12:38:29 UTC
*** Bug 138199 has been marked as a duplicate of this bug. ***
Comment 17 Eyal Rozenberg 2024-06-14 14:05:59 UTC
Created attachment 194737 [details]
Reduced and annotated testcase

This testcase reduces the necessary text to just one (short) line with two footnotes. But - it adds some boilerplate and annotation, so the problem can be easily noted when opening the file.
Comment 18 Commit Notification 2024-06-14 15:50:26 UTC
Jonathan Clark committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e78bb77c3c5930b20113bff3de2dd02065cead85

tdf#92091 Writer save and restore VCL state during recursion

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 19 Commit Notification 2024-06-17 08:39:40 UTC
Jonathan Clark committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/4d97af79a0332e882969f94710569c6cf70822f5

tdf#92091 Writer save and restore VCL state during recursion

It will be available in 24.8.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 20 Eyal Rozenberg 2024-07-13 09:14:11 UTC
Both testcase documents seem to render fine with build:

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 4c8f88bef948b18f3d810c29a7f83496367758a9
CPU threads: 4; OS: Linux 6.6; UI render: default; VCL: gtk3
Locale: en-IL (en_IL); UI: en-US

so - verifying.

Thanks, Jonathan.