Bug 152048 - Wrong rendering of underline for justified Arabic/Persian text with kashida
Summary: Wrong rendering of underline for justified Arabic/Persian text with kashida
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: ⁨خالد حسني⁩
URL:
Whiteboard: target:7.6.0 target:7.5.5 target:24.2...
Keywords:
Depends on:
Blocks: RTL-CTL Paragraph Character Kashida-Justification
  Show dependency treegraph
 
Reported: 2022-11-14 23:38 UTC by Hossein
Modified: 2023-08-30 10:27 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Justified Persian text (ODT), all the text is underlined (Wrong rendering) (14.12 KB, application/vnd.oasis.opendocument.text)
2022-11-14 23:41 UTC, Hossein
Details
Justified Persian text (ODT), all the text is underlined (Wrong rendering) (6.01 KB, application/pdf)
2022-11-14 23:42 UTC, Hossein
Details
Justified Persian text (ODT), without underlining below Kashida (14.14 KB, application/vnd.oasis.opendocument.text)
2022-11-14 23:46 UTC, Hossein
Details
Justified Persian text (PDF), without underlining below Kashida (6.03 KB, application/pdf)
2022-11-14 23:48 UTC, Hossein
Details
Justified Persian/English text (ODT), all the text is underlined (wrong rendering) (16.33 KB, application/vnd.oasis.opendocument.text)
2022-11-14 23:54 UTC, Hossein
Details
Justified Persian/English text (PDF), all the text is underlined (wrong rendering) (12.90 KB, application/pdf)
2022-11-14 23:56 UTC, Hossein
Details
Justified Persian/English text (PDF), all the text is underlined (LO 3.5) (12.90 KB, application/pdf)
2022-11-15 22:04 UTC, Hossein
Details
Justified Persian/English text (PDF), all the text is underlined (OOo 3.2) (12.91 KB, application/pdf)
2022-11-15 22:05 UTC, Hossein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2022-11-14 23:38:34 UTC
Description:
If you underline the text for a paragraph with justified Arabic/Persian text, there are situations that rendering of the underline for the text with kashida is incorrect.

Steps to Reproduce:
1. Open attachment. All the text should have underline

Actual Results:
The underline is cut off or rendered out of the correct region

Expected Results:
The underline should be rendered consistently below all of the text.

Reproducible: Always


User Profile Reset: No


Additional Info:
The problem is visible with the latest LO 7.5 dev master:

Version: 7.5.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 022eafa4d69bc8290aa304b69af2c325fe3d2a02
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Hossein 2022-11-14 23:41:14 UTC
Created attachment 183600 [details]
Justified Persian text (ODT), all the text is underlined (Wrong rendering)

All the text is underlined in this example. The rendering is incorrect because the underline falls out of the text margins.
Comment 2 Hossein 2022-11-14 23:42:57 UTC
Created attachment 183601 [details]
Justified Persian text (ODT), all the text is underlined (Wrong rendering)

This is the PDF output from the above ODT file with the latest LO 7.5 dev master
Comment 3 Hossein 2022-11-14 23:46:26 UTC
Created attachment 183602 [details]
Justified Persian text (ODT), without underlining below Kashida

This example is different from the above ODT/PDF because character with kashida is not underlined. As a result, LibreOffice correctly renders this example file! This difference shows that kashida is the root cause of this problem.
Comment 4 Hossein 2022-11-14 23:48:12 UTC
Created attachment 183603 [details]
Justified Persian text (PDF), without underlining below Kashida

This is the PDF output for the previous example. In this specific situation, the rendering becomes OK. See the above comment.
Comment 5 Hossein 2022-11-14 23:54:04 UTC
Created attachment 183604 [details]
Justified Persian/English text (ODT), all the text is underlined (wrong rendering)

This example is a mix of RTL/LTR text. All the text is underlined, but part of the text is not underlined, which shows incorrect rendering.
Just like previous example, If you select the character with kashida and remove underline from it by pressing Ctrl+u, underline for other parts of the word become OK.
Comment 6 Hossein 2022-11-14 23:56:37 UTC
Created attachment 183605 [details]
Justified Persian/English text (PDF), all the text is underlined (wrong rendering)

This is the PDF output from the previous example. The rendering is incorrect, because the underline is shown only partially, while all of the text has the underline style. Please see previous comment.
Comment 7 افشین 2022-11-15 04:25:55 UTC
I can reproduce this bug. 

Version: 7.4.2.3 / LibreOffice Community
Build ID: 40(Build:3)
CPU threads: 2; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: fa-IR (en_US.UTF-8); UI: en-US
Ubuntu package version: 1:7.4.2~rc3-0ubuntu0.22.04.1~lo1
Calc: threaded
Comment 8 ⁨خالد حسني⁩ 2022-11-15 20:10:04 UTC
It would be helpful to find out of this is a regression or not.
Comment 9 Hossein 2022-11-15 22:04:06 UTC
Created attachment 183614 [details]
Justified Persian/English text (PDF), all the text is underlined (LO 3.5)

The problem is reproducible with LO 3.5:

LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Comment 10 Hossein 2022-11-15 22:05:37 UTC
Created attachment 183615 [details]
Justified Persian/English text (PDF), all the text is underlined (OOo 3.2)

Reproducible with OOo 3.2

OpenOffice.org 3.2.1
OOO320m18 (Build: 9502)
Comment 11 Hossein 2022-11-15 22:25:24 UTC
(In reply to خالد حسني from comment #8)
> It would be helpful to find out of this is a regression or not.
With the above outputs from LO 3.5 and OOo 3.2.1, I can say this is not a regression. The situation is a little bit better now, but the main problem is inherited from OpenOffice.org.
Comment 12 ⁨خالد حسني⁩ 2023-05-25 11:32:39 UTC
(In reply to Hossein from comment #9)
> Created attachment 183614 [details]
> Justified Persian/English text (PDF), all the text is underlined (LO 3.5)
> 
> The problem is reproducible with LO 3.5:
> 
> LibreOffice 3.5.0rc3 
> Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735

This is likely to be a different issue. In the other issue the text width was adding the Kashida width more than once, leading to underline wider than the text, here the width is shorter (it seems to measure the width of the unjustified text), it is also Writer-specific, I can’t reproduce in module that use Edit Engine (e.g. Impress).
Comment 13 ⁨خالد حسني⁩ 2023-05-25 11:33:12 UTC
(In reply to خالد حسني from comment #12)
> (In reply to Hossein from comment #9)
> > Created attachment 183614 [details]
> > Justified Persian/English text (PDF), all the text is underlined (LO 3.5)
> > 
> > The problem is reproducible with LO 3.5:
> > 
> > LibreOffice 3.5.0rc3 
> > Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
> 
> This is likely to be a different issue. In the other issue the text width
> was adding the Kashida width more than once, leading to underline wider than
> the text, here the width is shorter (it seems to measure the width of the
> unjustified text), it is also Writer-specific, I can’t reproduce in module
> that use Edit Engine (e.g. Impress).

Please open a different issue for this one so we can track it.
Comment 14 Commit Notification 2023-05-25 12:18:28 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/43a5400063b17ed4ba4cbb38bdf5da4a991f60e2

tdf#152048: Fix underline width for Kashida-justified text

It will be available in 7.6.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 15 Commit Notification 2023-05-28 12:44:11 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

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

tdf#152048: Fix underline width for Kashida-justified text

It will be available in 7.5.5.

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 16 Hossein 2023-05-30 13:47:12 UTC
(In reply to خالد حسني from comment #12)
> (In reply to Hossein from comment #9)
> > Created attachment 183614 [details]
> > Justified Persian/English text (PDF), all the text is underlined (LO 3.5)
> > 
> > The problem is reproducible with LO 3.5:
> > 
> > LibreOffice 3.5.0rc3 
> > Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
> 
> This is likely to be a different issue. In the other issue the text width
> was adding the Kashida width more than once, leading to underline wider than
> the text, here the width is shorter (it seems to measure the width of the
> unjustified text), it is also Writer-specific, I can’t reproduce in module
> that use Edit Engine (e.g. Impress).
The remaining problem is filed as tdf#155557.
Comment 17 Commit Notification 2023-06-12 23:53:46 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/507759b449415e897ac0a1de03e8dd685b1e50fe

tdf#152048: Add test

It will be available in 24.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 18 Commit Notification 2023-06-12 23:53:48 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

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

tdf#152048: Fix measuring text width with font fallback

It will be available in 24.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 2023-06-13 07:35:27 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/87c8b85c273f285110ea3ae6d6fe99ece279b7b0

tdf#152048: Fix measuring text width with font fallback

It will be available in 7.6.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 Commit Notification 2023-06-13 12:45:03 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/34df6c92e513c5f428eff7c9cb1d6b9831eeb323

tdf#152048: Add test

It will be available in 7.6.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 21 Commit Notification 2023-06-23 20:53:29 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

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

tdf#152048: Fix measuring text width with font fallback

It will be available in 7.5.5.

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 22 Commit Notification 2023-08-23 10:01:11 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/8e5534b478efe4f383f214b9ab41fd3383e98296

tdf#156681: Revert "tdf#152048: Fix underline width for Kashida-justified text"

It will be available in 7.6.1.

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 23 Commit Notification 2023-08-23 11:39:32 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/7ead6fd72bef4713baf55e786f30b6870cc85609

tdf#156681: Revert "tdf#152048: Fix underline width for Kashida-justified text"

It will be available in 7.5.7.

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 24 Commit Notification 2023-08-30 10:27:53 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-5-6":

https://git.libreoffice.org/core/commit/0b5d67a3514f6b5f183733fa994906b9af47bbfe

tdf#156681: Revert "tdf#152048: Fix underline width for Kashida-justified text"

It will be available in 7.5.6.

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.