Bug 152024 - Diacritics are cut off in the last line of paragraph
Summary: Diacritics are cut off in the last line of paragraph
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisectRequest, regression
Depends on:
Blocks: RTL-CTL Font-Rendering
  Show dependency treegraph
 
Reported: 2022-11-13 18:33 UTC by Hossein
Modified: 2023-11-26 18:51 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Diacritics cut off (20.73 KB, application/vnd.oasis.opendocument.text)
2022-11-13 18:33 UTC, Hossein
Details
Diacritics is not cut off (PDF output) (7.49 KB, application/pdf)
2022-11-13 18:34 UTC, Hossein
Details
Diacritics cut off (screenshot from the display) (19.12 KB, image/png)
2022-11-13 18:37 UTC, Hossein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2022-11-13 18:33:47 UTC
Created attachment 183563 [details]
Diacritics cut off

Description:
In Arabic script languages like Arabic, Persian, etc., several diacritics are used; some of them are called 'harakat's. These diacritics are placed above or below the characters depending on their type.

In the last line of a paragraph, for the font size bigger than 150 with Tahoma font, rendering of diacritics below the characters is cut off. This is incorrect rendering.

This problem is limited to the display, as the output is correct, without cut off.

Steps to Reproduce:


Actual Results:
In the first page of attachment, there are 3 paragraphs, each one a single line, containing text with font size 150, 151, and 152 respectively. In this case, the diacritics in the 2 last lines are cut off.

In the second page of the attachment, there is only 1 paragraph that is wrapped into 3 lines. The font sizes are equal to the ones in the first page. In this page, only the last line with font size 152 has cut off diacritics.

Expected Results:
Mo cut off in the diacritics

Reproducible: Always


User Profile Reset: No


Additional Info:
Version: 7.5.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 75b569890a6630bb2a5b727c8567f7ea59ccb62e
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

For more information about diacritics, One may refer to:
* Diacritic
  https://en.wikipedia.org/wiki/Diacritic#Arabic
* Arabic Diacritic
  https://en.wikipedia.org/wiki/Arabic_diacritics
Comment 1 Hossein 2022-11-13 18:34:43 UTC
Created attachment 183564 [details]
Diacritics is not cut off (PDF output)

The PDF output is OK.
Comment 2 Hossein 2022-11-13 18:37:16 UTC
Created attachment 183565 [details]
Diacritics cut off (screenshot from the display)

The display is wrong, and the diacritics are cut off
Comment 3 raal 2022-11-13 19:52:01 UTC
confirm with Version: 7.5.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: cfc8a8f5d841b3f84d207196153be67da7f60652
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded

and Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a) - in 4.1 it's different.
Comment 4 Hossein 2022-11-24 08:29:56 UTC
Not reproducible with LO 3.5:
LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735

It is important to add that sometimes (but not always) the cut off goes away when tatweel character (ـ) is removed from the text.
Comment 5 Stéphane Guillou (stragu) 2023-10-13 08:16:24 UTC
For me, checking with the libreoffice-64-releases bibisect repository, the situation really changed at libreoffice-4.1.4.2:

- OOo 3.3 > libreoffice-4.1.4.1: display is sometimes wrong for the first paragraph on fileopen, bug zoom changes refresh and correct the view. However, scroll up and down makes diacritic appear cut off.
- since libreoffice-4.1.4.2 and still current in recent trunk build: all paragraphs displayed wrong from fileopen; a zoom does no refresh the view anymore.

So I see a temporary display issue inherited from OOo, but it's now permanent since 4.1.4.2.
Not sure what is relevant in these changes:
https://wiki.documentfoundation.org/Releases/4.1.4/RC2#List_of_fixed_bugs

(In reply to raal from comment #3)
> and Version 4.1.0.0.alpha0+ (Build ID:
> efca6f15609322f62a35619619a6d5fe5c9bd5a) - in 4.1 it's different.

I assume that's the difference you saw, raal?

Khaled, maybe you have an idea?
Comment 6 ⁨خالد حسني⁩ 2023-10-17 13:43:19 UTC
Sounds like a clipping issue. We have lots of these, and there are many similar bug reports affecting Latin diacritics and other writing systems. It appears that we use the font’s ascender and descender to calculate the clipping box, but they are meant to control line spacing and fonts often has glyphs that go beyond them. I never figured out where is this clipping code, so this is just speculative.
Comment 7 ⁨خالد حسني⁩ 2023-11-26 18:47:48 UTC Comment hidden (obsolete)