Bug 106309 - Wrong placement of kashida causes defect in Arabic/Persian text rendering
Summary: Wrong placement of kashida causes defect in Arabic/Persian text rendering
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: ⁨خالد حسني⁩
URL:
Whiteboard: target:7.5.0 inReleaseNotes:7.5
Keywords:
Depends on: 104921
Blocks: Font-Rendering RTL-Arabic-and-Farsi Kashida-Justification
  Show dependency treegraph
 
Reported: 2017-03-03 21:14 UTC by Hossein
Modified: 2022-12-06 17:05 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of defect in LO Writer (2.50 KB, image/png)
2017-03-03 21:16 UTC, Hossein
Details
Defect in LO Writer (8.53 KB, application/vnd.oasis.opendocument.text)
2017-03-03 21:17 UTC, Hossein
Details
Defect in LO Impress (11.37 KB, application/vnd.oasis.opendocument.presentation)
2017-03-03 21:17 UTC, Hossein
Details
There is this bug in 5.2.5.1 version too. (51.59 KB, image/png)
2017-03-09 05:50 UTC, افشین
Details
the bug in 6.1.5.2 (32.28 KB, application/vnd.oasis.opendocument.presentation)
2019-03-08 18:50 UTC, Fahad Al-Saidi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2017-03-03 21:14:17 UTC
Description:
When using the option "Set Character Spacing" in "Properties" section of the sidebar, if the text is Arabic, then kashida is used to stretch the text, and because kashida is placed in wrong places, it causes defect in Arabic/Persian text rendering.

There was an old bug in Arabic/Persian text rendering that created defects, it was fixed before AO 3, then It was recreated when HarfBuzz was used, and it is now fixed in LibreOfffice 5.3. But it seems that there are still issues needed to be fixed.

Bug 35320 - EDITING: Justified problem in arabic
https://bugs.documentfoundation.org/show_bug.cgi?id=35320

Steps to Reproduce:
1. Open libreoffice Writer or Impress.
2. Type some Arabic/Persian language text like "به نام خدا".
3. Open "Properties" from sidebar.
4. Open "Set Character Spacing" box, then choose "Very Loose".

Actual Results:  
Wrong placement of kashida causes defect in Arabic/Persian text rendering

Expected Results:
kashida should be placed to increase the size of rendered words


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0
Comment 1 Hossein 2017-03-03 21:16:58 UTC
Created attachment 131617 [details]
Screenshot of defect in LO Writer
Comment 2 Hossein 2017-03-03 21:17:31 UTC
Created attachment 131618 [details]
Defect in LO Writer
Comment 3 Hossein 2017-03-03 21:17:57 UTC
Created attachment 131619 [details]
Defect in LO Impress
Comment 4 Buovjaga 2017-03-04 19:48:28 UTC
Reproduced.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.0.alpha0+
Build ID: ed0e8f970ff552e75222dc92ed2879aa3b3e5851
CPU threads: 8; OS: Linux 4.9; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on March 4th 2016
Comment 5 ⁨خالد حسني⁩ 2017-03-04 22:13:34 UTC
This does not look like a new issue, can some one test with 5.2 or earlier?
Comment 6 ⁨خالد حسني⁩ 2017-03-04 22:16:23 UTC
Bug 104921 explains the root of most of these kashida issues. It is bad design decision that has been band-aided all the time instead of fixing the root cause.
Comment 7 افشین 2017-03-09 05:50:24 UTC
Created attachment 131765 [details]
There is this bug in 5.2.5.1 version too.

There is this bug in version 5.2.5.1 too.
Comment 8 ⁨خالد حسني⁩ 2017-03-09 12:04:35 UTC
I suspect it even goes older than that, even all the way back to the first LibreOffice release.
Comment 9 Buovjaga 2017-03-10 19:11:48 UTC
(In reply to Khaled Hosny from comment #8)
> I suspect it even goes older than that, even all the way back to the first
> LibreOffice release.

Yep.

Char spacing Very Loose == 6 pts.

Arch Linux 64-bit
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 10 ⁨خالد حسني⁩ 2017-03-10 19:19:52 UTC
Using letter spacing with Arabic script does not make much sense as it breaks the letters. CSS even goes far to require that browsers ignore letter spacing for scripts like Arabic, we probably should do that at some point, if only to prevent users from shooting themselves in the foot.
Comment 11 Hossein 2017-03-10 19:25:50 UTC
Some presentation templates use custom letter spacing. This is usually the source of problem. It may work for other languages, but right now, not for languages based on Arabic script.
Comment 12 QA Administrators 2018-03-11 03:41:14 UTC Comment hidden (noise)
Comment 13 Fahad Al-Saidi 2019-03-08 18:49:18 UTC
I am using Version: 6.1.5.2 and I am still face this problem. I was just copying and pasting a text from the web. I don't find any workaround to solve this problem. I am not using letter spacing anyhow.
Comment 14 Fahad Al-Saidi 2019-03-08 18:50:43 UTC
Created attachment 149834 [details]
the bug in 6.1.5.2
Comment 15 QA Administrators 2021-03-08 04:01:54 UTC Comment hidden (noise, obsolete)
Comment 16 Hossein 2021-09-30 08:20:41 UTC
Still reproducible in

Version: 7.2.0.4 / LibreOffice Community
Build ID: 9a9c6381e3f7a62afc1329bd359cc48accb6435b
CPU threads: 8; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

And also in the latest master:

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: 18e49d2b998ba69d5363d25d285ee6fd188a698d
CPU threads: 8; OS: Linux 5.11; UI render: default; VCL: x11
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 17 ⁨خالد حسني⁩ 2022-08-11 19:17:45 UTC
(In reply to Fahad Al-Saidi from comment #14)
> Created attachment 149834 [details]
> the bug in 6.1.5.2

This is a different issue not related to the original bug report. For some reason starting the text with a LTR character messes up the spacing. Please report a separate issue for this one.
Comment 18 ⁨خالد حسني⁩ 2022-08-12 21:37:55 UTC
(In reply to Khaled Hosny from comment #17)
> (In reply to Fahad Al-Saidi from comment #14)
> > Created attachment 149834 [details]
> > the bug in 6.1.5.2
> 
> This is a different issue not related to the original bug report. For some
> reason starting the text with a LTR character messes up the spacing. Please
> report a separate issue for this one.

Same issue as bug 103492.
Comment 19 Hossein 2022-08-13 10:38:25 UTC
(In reply to Khaled Hosny from comment #17)
> (In reply to Fahad Al-Saidi from comment #14)
> > Created attachment 149834 [details]
> > the bug in 6.1.5.2
> 
> This is a different issue not related to the original bug report. For some
> reason starting the text with a LTR character messes up the spacing. Please
> report a separate issue for this one.

Done. Please see bug 150395 for the new bug report.
Comment 20 ⁨خالد حسني⁩ 2022-08-14 19:50:28 UTC
https://git.libreoffice.org/core/+/3901e029bd39575f700e69a73818565d62226a23

This fixes the extranous Kashidas, but leaves spaces between the letter (which is consistent which how other applications handle letter-spacing in Arabic). It might be worth opening a feature request to either ignore stretching for Arabic or insert Kashida instead of leaving gaps (it might be worth checking what other office suites do in this case).
Comment 21 Stéphane Guillou (stragu) 2022-12-06 17:05:35 UTC
Verified that "wrong" kashidas are replaced by empty spaces in:

Version: 7.5.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: c9e961e6803a70587bd4686d05abdd4ac11de434
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Thanks Khaled!