Bug 150516 - Justified Arabic text is displayed with gaps on some zoom levels
Summary: Justified Arabic text is displayed with gaps on some zoom levels
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: RTL-CTL RTL-Arabic-and-Farsi Kashida-Justification
  Show dependency treegraph
 
Reported: 2022-08-20 12:41 UTC by Hossein
Modified: 2023-07-11 03:53 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Visible gaps between characters in the display for justified text (88.22 KB, image/jpeg)
2022-08-20 12:43 UTC, Hossein
Details
Visible gaps between characters in the display for the last line (86.62 KB, image/jpeg)
2022-08-20 12:44 UTC, Hossein
Details
Example using KacstPen font (20.58 KB, application/vnd.oasis.opendocument.text)
2022-10-06 11:07 UTC, Hossein
Details
Example using KacstPen font (PNG screenshot from screen) (77.88 KB, image/png)
2022-10-06 11:10 UTC, Hossein
Details
Example using KacstPen font (PDF) (4.94 KB, application/pdf)
2022-10-06 11:12 UTC, Hossein
Details
Screenshot showing kashida glyph outlines. (63.95 KB, image/png)
2022-10-06 11:24 UTC, ⁨خالد حسني⁩
Details
Visible gaps in the display for justified text with DecoType Naskh font (23.33 KB, application/vnd.oasis.opendocument.text)
2023-07-10 21:00 UTC, Hossein
Details
Visible gaps in the display for justified text with DecoType Naskh font (PDF) (8.15 KB, application/pdf)
2023-07-10 21:02 UTC, Hossein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2022-08-20 12:41:32 UTC
Description:
With the latest patches from Khaled, LibreOffice writer (almost) correctly exports the justified Arabic text to the PDF formt. On the other hand, on the screen, there are certain glitches that happen when the display zoom is set on 100%.

Steps to Reproduce:
1. Open the attachment 169697 [details] from the bug 139627
2. Set the zoom level to 100% from the bottom of the screen

Actual Results:
Big gaps are visible between the characters

Expected Results:
These characters should be joined together in the Arabic script.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: f505d8fee149f089090b208db99a7b4107af76e9
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: fa-IR (fa_IR); UI: en-US
Calc: threaded
Comment 1 Hossein 2022-08-20 12:43:10 UTC
Created attachment 181899 [details]
Visible gaps between characters in the display for justified text
Comment 2 Hossein 2022-08-20 12:44:01 UTC
Created attachment 181900 [details]
Visible gaps between characters in the display for the last line
Comment 3 ⁨خالد حسني⁩ 2022-08-20 12:49:15 UTC
I just noticed something like this today as well, but I don’t know when this regressed. Can you bibisect?
Comment 4 Hossein 2022-08-20 13:15:43 UTC
(In reply to خالد حسني from comment #3)
> I just noticed something like this today as well, but I don’t know when this
> regressed. Can you bibisect?

Yes, I will do a bibisect.

In the latest stable, LibreOffice 7.4, I see that in a certain zoom level (75%), this glitch happens. On other zoom levels, the face of the output is different, and their problem is fixed in the latest 7.5 master.

Could you please confirm this bug?
Comment 5 ⁨خالد حسني⁩ 2022-08-20 13:50:08 UTC
(In reply to Hossein from comment #4)
> Could you please confirm this bug?

I’m unable to reproduce this, but it might be differences between the version of the font (and/or different screen resolution, I’m on a hidpi screen and sometimes issues show up at different zoom levels from what others report).

I’m seeing a different issue that may or may not be related to this, that should be fixed with https://gerrit.libreoffice.org/c/core/+/138588.
Comment 6 Gowrishankar 2022-09-11 06:54:11 UTC
 REPRODUCED

STEPS TO FOLLOWED

1. I have open the given attachment and set it pt into 162pt no glitches .
2. And the spacing also following correct while it in full zoom.


ENVIRONMENT

OS : WINDOWS HOME 10 
LIBRE OFFICE VERSION :Version: 7.4.0.3 (x64) / LibreOffice Community
Comment 7 S.DINESH 2022-09-11 07:50:14 UTC
STATUS:REPRODUCED

STEPS TO FOLLOWED:
          1: Set the zoom level to 100% from the bottom of the screen.
          2:I will Testing the Zoom level 100% is( linux mint) is performed good.

ENVIRONMENT:
     OS:LINUX MINT 20.1 CINNAMON
VERSION:4.8.5
PROCESSOR:AMD PRO A4-4350B R4.
Comment 8 Hossein 2022-10-06 11:07:56 UTC
Created attachment 182857 [details]
Example using KacstPen font

This example uses KacstPen font from fonts-kacst package on Ubuntu 22.04, and the kashida has two visible problems:

1. The visible gap between multiple kashidas
2. The inconsistency between kashida height and the text

Reproduced with the latest LO 7.5 dev master:

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

The KacstPen font can be downloaded from:
https://packages.ubuntu.com/jammy/fonts-kacst
http://archive.ubuntu.com/ubuntu/pool/main/f/fonts-kacst/fonts-kacst_2.01+mry.orig.tar.bz2
Comment 9 Hossein 2022-10-06 11:10:28 UTC
Created attachment 182858 [details]
Example using KacstPen font (PNG screenshot from screen)

This is a screenshot from the display at 100% zoom. Gaps are visible between kashidas. Also, the incorrect height/vertical position of the kashidas can be seen.
Comment 10 Hossein 2022-10-06 11:12:08 UTC
Created attachment 182859 [details]
Example using KacstPen font (PDF)

This is the PDF output from the above example. The horizontal and vertical problems with kashidas are visible in the PDF output.
Comment 11 Hossein 2022-10-06 11:22:26 UTC
@Khaled:
The problem is easier to reproduce with with the KacstPen font. Could you please take a look?
Comment 12 ⁨خالد حسني⁩ 2022-10-06 11:24:11 UTC
Created attachment 182860 [details]
Screenshot showing kashida glyph outlines.

(In reply to Hossein from comment #8)
> Created attachment 182857 [details]
> Example using KacstPen font
> 
> This example uses KacstPen font from fonts-kacst package on Ubuntu 22.04,
> and the kashida has two visible problems:
> 
> 1. The visible gap between multiple kashidas
> 2. The inconsistency between kashida height and the text
> 
> Reproduced with the latest LO 7.5 dev master:
> 
> 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
> 
> The KacstPen font can be downloaded from:
> https://packages.ubuntu.com/jammy/fonts-kacst
> http://archive.ubuntu.com/ubuntu/pool/main/f/fonts-kacst/fonts-kacst_2.
> 01+mry.orig.tar.bz2

Please open different bug reports for different issues.

This is badly drawn font. The kasida glyph goes below the basline but other glyphs don’t, and does not have enough overlap so when rendered at low resolution gaps can be visible.

Compare how low the lower line of the kashida rectangle compared the glyph next to it, and how the overlapping part on the left is to small compared to the other glyph.
Comment 13 Hossein 2022-10-06 11:55:54 UTC
(In reply to خالد حسني from comment #12)
> Please open different bug reports for different issues.
> 
> This is badly drawn font. The kasida glyph goes below the basline but other
> glyphs don’t, and does not have enough overlap so when rendered at low
> resolution gaps can be visible.
> 
> Compare how low the lower line of the kashida rectangle compared the glyph
> next to it, and how the overlapping part on the left is to small compared to
> the other glyph.

Thanks for the explanation!

But, I think this font actually reveals the fact that in different zoom levels, the amount of overlap between adjacent kashidas differs slightly, because of rounding or any other reason.

When I zoom in and out, the gap between kashida and the adjacent character remains, but the gap between adjacent kashidas goes away.

I think this can be helpful in debugging the problem that is discussed here.
Comment 14 ⁨خالد حسني⁩ 2022-10-06 12:10:55 UTC
(In reply to Hossein from comment #13)
> When I zoom in and out, the gap between kashida and the adjacent character
> remains, but the gap between adjacent kashidas goes away.
> 
> I think this can be helpful in debugging the problem that is discussed here.

May be, but I’m yet to understand ho the new resolution independent positioning works and why it is not preventing these rounding errors.
Comment 15 Eyal Rozenberg 2023-04-05 21:20:02 UTC
So, should this bug be re-titled to be about this specific font? Some set of fonts? Or is it actually general?
Comment 16 ⁨خالد حسني⁩ 2023-05-24 18:19:11 UTC
What is the status here, is this issue still reproducible, if so can we have instructions to reproduce it with a font other than KacstPen?
Comment 17 Hossein 2023-07-10 21:00:37 UTC
Created attachment 188300 [details]
Visible gaps in the display for justified text with DecoType Naskh font

(In reply to ⁨خالد حسني⁩ from comment #16)
> What is the status here, is this issue still reproducible, if so can we have
> instructions to reproduce it with a font other than KacstPen?
I can still reproduce it with some fonts other than Kacst*. For example, with "DecoType Naskh *". See the attachment.
Comment 18 Hossein 2023-07-10 21:02:16 UTC
Created attachment 188301 [details]
Visible gaps in the display for justified text with DecoType Naskh font (PDF)

Visible gaps in the PDF created with LO 24.2 dev master:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 7db3c6b25a8c57beab7dae4e0e1497e7b06f3662
CPU threads: 20; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_DE); UI: en-US
Calc: CL threaded
Comment 19 QA Administrators 2023-07-11 03:14:04 UTC Comment hidden (obsolete)