Bug 85426 - VIEWING: Fixing line space crops Arabic tashkeel below in Amiri font
Summary: VIEWING: Fixing line space crops Arabic tashkeel below in Amiri font
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 113102 (view as bug list)
Depends on:
Blocks: Paragraph-Line-Spacing Arabic-and-Farsi Diacritics
  Show dependency treegraph
 
Reported: 2014-10-25 04:20 UTC by Ghasan
Modified: 2024-08-26 14:33 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Comparison between LibreOffice rendering and PDF. (12.54 KB, application/zip)
2014-10-25 04:20 UTC, Ghasan
Details
Original files (15.34 KB, application/zip)
2014-10-25 05:54 UTC, Ghasan
Details
PDF output in 4.3.2.2 (8.32 KB, application/pdf)
2014-10-25 07:10 UTC, tommy27
Details
Word 2013 Output (14.11 KB, image/jpeg)
2015-12-24 18:30 UTC, Ghasan
Details
Same text and font in Google Chrome (61.27 KB, image/png)
2017-10-13 19:38 UTC, ⁨خالد حسني⁩
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ghasan 2014-10-25 04:20:14 UTC
Created attachment 108378 [details]
Comparison between LibreOffice rendering and PDF.

It is just as the summary.

I am using Amiri font for writing RTL text.
Comment 1 tommy27 2014-10-25 05:40:45 UTC
please upload the original .odt file as well, not only screenshots.
Comment 2 Ghasan 2014-10-25 05:54:56 UTC
Created attachment 108379 [details]
Original files

Here are the original files. BTW, I noticed also some glitches when navigating letters. For example, I can't navigate to the start of the second line, and would need to advance to three of four letters in case I want to delete the first letter in the second line. I think this is logical vs visual issue.
Comment 3 tommy27 2014-10-25 07:10:11 UTC
Created attachment 108382 [details]
PDF output in 4.3.2.2

try upgrading to LibO 4.3.2.2 and export your .doc file to PDF
compare with my attached PDF

it seems much better than your PDF output in 4.2.6.3.
do you agree or do you still see PDF export issues?
Comment 4 Ghasan 2014-10-25 08:02:06 UTC
I downloaded the latest 4.3 and no longer facing the issue of navigating letters I mentioned in my second comment. However, the view is still the same.

In the PDF I attached you can see the diacritics of the first line (below إ letters), however they are not visible when working on LibreOffice.
Comment 5 Ghasan 2014-11-04 10:54:42 UTC
I found this question on Superuser.com, and it seems similar to my case.
https://superuser.com/questions/776047/arabic-in-libreoffice-composite-character-chopped-off-at-the-top
Comment 6 tommy27 2014-11-05 07:02:07 UTC
Ok, I set status to NEW because of that website confirmation
Comment 7 QA Administrators 2015-12-20 16:12:16 UTC Comment hidden (obsolete)
Comment 8 Ghasan 2015-12-24 18:30:43 UTC
Created attachment 121537 [details]
Word 2013 Output

It looks like either an issue with the font, or that the font is supporting advanced OpenType features that is not widely used (I have heard once about its use of various use of OpenType.)

The issue manifests also with Word 2013. The issue as my obeservation is that when I fix the height of the line and they ended overlapping when they span multiple lines, the "overflow" content (especially when using diacritics) of each line is cut short. However, when it is printed, PDF seems to let them overlap without interference.
Comment 9 QA Administrators 2017-01-03 19:57:41 UTC Comment hidden (obsolete)
Comment 10 Yousuf Philips (jay) (retired) 2017-10-13 17:45:43 UTC
So this happens in Amiri (v0.107-1 on my ubuntu 16.04-based system and v0.109 from github), but doesnt in any arabic font that comes by default on Windows, so i presume its a problem with the font. I field a separate bug for the issue mentioned in comment 5 in bug 113102.

Khaled: What is your take on this, as you are the font creator?
Comment 11 ⁨خالد حسني⁩ 2017-10-13 19:17:39 UTC
That is another clipping issue, we are clipping the text to the line height not to the bounding box as we should. This is triggered with Amiri since its vowel marks are generally high than simpler fonts, but the PDF renders fine since it does not suffer from the same clipping limitations that LibreOffice own rendering has.
Comment 12 ⁨خالد حسني⁩ 2017-10-13 19:37:19 UTC
MS Office has the same clipping issues as LibreOffice. Compare with web browsers (e.g. Firefox or Chrome) that have no issue:

data:text/html;charset=utf8,<p style="font: 20pt/170% Amiri; width: 800px; direction:rtl;word-break: break-all;">إإٍإٍإٍإٍإٍإٍإٍإٍإٍإٍإٍإٍإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإإأأأأأًأًأًأًأًأًأًأًأًأًأًأأأأأأأأأأأأأأأأأأأأأأأأأأأأأأأأأأأأأأأ.</p>
Comment 13 ⁨خالد حسني⁩ 2017-10-13 19:38:48 UTC
Created attachment 136962 [details]
Same text and font in Google Chrome
Comment 14 QA Administrators 2018-10-14 02:57:11 UTC Comment hidden (obsolete)
Comment 15 QA Administrators 2020-10-14 04:30:57 UTC Comment hidden (obsolete)
Comment 16 Kamil Landa 2022-08-16 16:17:42 UTC
*** Bug 150439 has been marked as a duplicate of this bug. ***
Comment 17 Kamil Landa 2022-08-16 16:19:09 UTC
*** Bug 113102 has been marked as a duplicate of this bug. ***
Comment 18 ⁨خالد حسني⁩ 2022-08-17 00:48:56 UTC
I think this is a clipping issue.

Ideally applications should be using the clipping font metrics to determine the height and depth of the clipping region (AKA OS/2 usWinAscent/usWinDescent https://docs.microsoft.com/en-us/typography/opentype/spec/os2#uswinascent), but it seems that LO is (sometimes?) using line spacing instead.
Comment 19 Sophie Sipasseuth 2023-12-14 09:39:18 UTC
Repro, the display of the pdf and the odt files in LibreOffice is not correct compared to what is expected:

Version: 24.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: bfbae5ddd52cf80af94b250b9de349f0340dbe34
CPU threads: 8; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: threaded
Comment 20 Volga 2024-08-26 14:17:06 UTC Comment hidden (no-value)
Comment 21 Volga 2024-08-26 14:21:24 UTC Comment hidden (no-value)
Comment 22 Volga 2024-08-26 14:33:51 UTC
I saw this is still reproduced with

Version: 24.8.0.3 (X86_64) / LibreOffice Community
Build ID: 0bdf1299c94fe897b119f97f3c613e9dca6be583
CPU threads: 4; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win
Locale: zh-CN (zh_CN); UI: zh-CN
Calc: threaded
--------------------------------------------------------------------------
Here I saw a comment oppugn the method to handle line height on MS Windows. 
https://github.com/ButTaiwan/genyog-font/issues/13#issuecomment-2251756173

This is his comment and my translation:

思源有收三倍長 em-dash,因為還有收直排版本。所以 ascent + descent 高達 3000。
Source Han Sans have three-em-dash, because it is also includes vertical version, so ascent + descent is up to 3000.
就算是源樣拿掉三倍長版本,但因為留下兩倍長的,理論上仍然還有 2000。
Even if GenYo Gothic removed three-em-dash, but due to two-em-dash is preserved, ideally it's still 2000.
另外如樓上所說,日文有 https://zi-hi.com/sp/uni/3031 這個符號,它的高度也是 2000。
In addition, as above comment, Japanese has the symbol 〱 (U+3031), it's height is also 2000.
當然因為直排字符去影響正常的橫排高度不太合理,所以源樣採用竄改 win descent 跟 FontBBox 的作法。
Certainly because it doesn't make sense to make vertical glyphs affect horizontal line height, so GenYo Gothic uses modifying win descent and FontBBox.
基本上這就是字型的技術債。
It's basically technical debt of the font.
ascent / descent 本來應該只是 typography 上的抽象高度,用來描述理想的行高、x-height等相對位置。
Ascent/descent should be only abstract heights among typography that used to describe ideally relative position for line height, x-height, etc.
就像 macOS 內建的 Zapfino 字型,ascent / descent 都侵略性地直接重疊到上下行,但這正式傳統歐文書法的風格。
Such as macOS built-in font Zapfino, both ascent/descent are just aggressively overlap neighboring lines, but this is traditional European caligraphy style.
然而 Windows 舊的渲染引擎卻拿 win descent 值當作渲染時的裁切邊界。完全不容許兩行發生重疊(甚至中間還被強制留一些行間)。
However Windows legacy rendering engine used win descent value as clipping boundry for rendering. Completely oppose two neighboring lines overlap each other (even forced leaves line gaps in the middle).

So I think this should be fixed via integrating an independent library that makes LibreOffice jump out of system calls for glyph rendering.