Bug 151374 - Problem with justified text and Nastaliq font
Summary: Problem with justified text and Nastaliq font
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.4.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-06 11:35 UTC by Hossein
Modified: 2022-10-07 04:37 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example using NotoNastaliqUrdu font (15.85 KB, application/vnd.oasis.opendocument.text)
2022-10-06 11:35 UTC, Hossein
Details
Example using NotoNastaliqUrdu font (PDF) (9.32 KB, application/pdf)
2022-10-06 11:36 UTC, Hossein
Details
Example using NotoNastaliqUrdu font with LO 7.5 dev master (PDF) (8.87 KB, application/pdf)
2022-10-06 11:44 UTC, Hossein
Details
Example using NotoNastaliqUrdu font creating visible gaps with LO 7.5 (17.82 KB, application/vnd.oasis.opendocument.text)
2022-10-06 11:47 UTC, Hossein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2022-10-06 11:35:09 UTC
Created attachment 182861 [details]
Example using NotoNastaliqUrdu font

Description:
Nastaliq fonts, for example "Noto Nastaliq Urdu" and "IranNastaliq" are different from Normal Arabic/Persian/Urdu fonts in the way Kashidas are implemented.
This example uses "Noto Nastaliq Urdu" font which does not use kashida at all. IranNastaliq font works with kashida, but they are implemented as ligatures.
Using the horizontal lines as kashidas with Nastaliq fonts causes rendering defects.


Steps to Reproduce:
1. Install NotoNastaliqUrdu font
2. Open the example file


Actual Results:
Bad black lines are visible in the output. Kashida is not suitable for Nastaliq font.


Expected Results:
No black lines should be visible in the output. Also, the spacing of the characters should not be very big.


Reproducible: Always



User Profile Reset: No



Additional Info:

Reproduced with the LO 7.4:

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

The "NotoNastaliqUrdu" font can be downloaded from the fonts-noto-core package on Ubuntu 22.04:

https://packages.ubuntu.com/jammy/fonts-noto-core
Comment 1 Hossein 2022-10-06 11:36:24 UTC
Created attachment 182862 [details]
Example using NotoNastaliqUrdu font (PDF)

The bad horizontal black lines are visible in the PDF output
Comment 2 Hossein 2022-10-06 11:44:52 UTC
Created attachment 182866 [details]
Example using NotoNastaliqUrdu font with LO 7.5 dev master (PDF)

This is the PDF output using NotoNastaliqUrdu font using LO 7.5 dev master.
In this example, the bad black lines went away, but the exaggerated space is there.

This is because in LO 7.5 dev master, rendering of bad kashidas are avoided, but then the big gaps will be visible in the output.

Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: d23b1d0240e8ca4a33fbd4fcd368c4ece7b8866a
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 3 Hossein 2022-10-06 11:47:00 UTC
Created attachment 182867 [details]
Example using NotoNastaliqUrdu font creating visible gaps with LO 7.5

This is the nastaliq2.odt file used to generate the above PDF output.
Comment 4 ⁨خالد حسني⁩ 2022-10-06 12:06:17 UTC
The enlarged spacing is all we can do with the current Kashida insertion method which happens after shaping (so the font has no input on it).

Addressing this properly is a much bigger issue and it might involve changes to the OpenType format and/or the OpenType shaping engine we use (HarfBuzz).
Comment 5 ⁨خالد حسني⁩ 2022-10-06 12:08:00 UTC
Any of this wouldn’t help Noto Nastaliq Urdu since it does not have Kashida it all, so the big spacing is how it is expected to be justified.
Comment 6 Hossein 2022-10-06 21:20:16 UTC
(In reply to خالد حسني from comment #5)
> Any of this wouldn’t help Noto Nastaliq Urdu since it does not have Kashida
> it all, so the big spacing is how it is expected to be justified.
Ok, then can you provide the commit in which the fix is provided, and close this bug as FIXED?
I can discuss the problem with the big space in another bug report.
Comment 7 ⁨خالد حسني⁩ 2022-10-07 04:37:29 UTC
Fixed in https://git.libreoffice.org/core/+/9a6b673699fa925f5d87e47d4b359f37ad27260e