Bug 39351 - incorrect FORMATTING of Arabic Subtending marks
Summary: incorrect FORMATTING of Arabic Subtending marks
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
3.4.1 release
Hardware: All Linux (All)
: medium normal
Assignee: ⁨خالد حسني⁩
URL:
Whiteboard: target:5.3.0
Keywords:
Depends on: HarfBuzz
Blocks: Arabic-and-Farsi RTL CTL
  Show dependency treegraph
 
Reported: 2011-07-18 12:51 UTC by BobH
Modified: 2024-09-19 12:30 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Subtending marks -- works with gedit (50.66 KB, image/jpeg)
2011-07-18 12:51 UTC, BobH
Details
Subtending marks -- fails with Writer (40.55 KB, image/jpeg)
2011-07-18 12:52 UTC, BobH
Details
Subtending marks -- test document (10.35 KB, application/vnd.oasis.opendocument.text)
2011-07-18 12:53 UTC, BobH
Details
Subtending marks with LO 25.02 nightly - looks pretty bad (54.92 KB, image/png)
2024-09-17 20:13 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description BobH 2011-07-18 12:51:43 UTC
Created attachment 49267 [details]
Subtending marks -- works with gedit

Brief:

With OpenType rendering, only one digit following a subtending mark (U+0600 .. U+0605, or U+06DD) is rendered correctly; 2nd and following digits are rendered normally.

Extended description:

Subtending marks (U+0600 .. U+0605, U+06DD) are typically followed by digits which, assuming appropriate font logic (OpenType, Graphite, etc), are then rendered with small glyphs positioned within (or above or below) the subtending mark. These are rendered correctly by gedit -- see attached "Subtending Marks -- gedit.jpg". 

NB: The font Scheherazade v1.0005 from https://scripts.sil.org/arabicfonts has the OpenType logic for subtending marks U+0600..U+0603 and U+06DD, and was used for this testing.  Any implementation will have limits on the number of digits supported -- Scheherazade supports up to 2, 3, or 4 digits depending on the subtending mark. I've also included writer doc "Subtending Marks.ODT" which contains test data.

LibreOffice 3.4.1 running on Windows appears to depend on Uniscribe for rendering, and works correctly for the digits from the Arabic block (U+0660 .. U+0669 and U+06F0 .. U+06F9) but not for the "Latin" digits (U+0030 .. U+0039). Nothing you can do about this.

However:

Writer from LibreOffice 3.4.1 on UBuntu 11.04 fails to correctly render more than one digit. That is, the first digit after the subtending mark is correct, subsequent digits are not.  See attached "Subtending Marks -- Writer.jpg"

Bob
Comment 1 BobH 2011-07-18 12:52:42 UTC
Created attachment 49268 [details]
Subtending marks -- fails with Writer
Comment 2 BobH 2011-07-18 12:53:12 UTC
Created attachment 49269 [details]
Subtending marks -- test document
Comment 3 ⁨خالد حسني⁩ 2011-12-07 23:15:04 UTC
This looks very suspiciously like a bug in ICU layout engine (which is what LO use on Linux). The only other application using ICU that I've is XeTeX, but there not even the first correct. This even seems to affect only Scheherazade, other fonts like Amiri (http://www.amirifont.org, disclaimer: mine) or even Arabic Typesetting seem to work fine (though both have different limit on the number digits than Scheherazade).
Comment 4 Björn Michaelsen 2011-12-23 12:21:49 UTC Comment hidden (obsolete)
Comment 5 sasha.libreoffice 2012-01-27 10:57:27 UTC
reproduced in LibO 3.6.0 master on Fedora 64 bit
Comment 6 QA Administrators 2015-04-19 03:21:05 UTC Comment hidden (obsolete)
Comment 7 ⁨خالد حسني⁩ 2015-04-19 20:03:20 UTC
This still an issue, and if anyone wants to work in this, it is because GenericSalLayout::ApplyDXArray() is messing with glyph positioning. This code is broken beyond by design and the only way to fix it is by killing it and fixing all use sites to not need it.
Comment 8 BobH 2015-04-20 01:06:16 UTC
Still fails on LO 4.4.2.2

Note that Scheherazade is now at version 2.020 (see http://scripts.sil.org/scheherazade for latest) and the OpenType logic has been improved to be more robust with different rendering systems. However the font now includes Graphite tables and, since the default rendering for LO is with Graphite enabled, one might be fooled into thinking the bug has been fixed.

But the problem is with OpenType logic. To force LO to disable Graphite and thus render Scheherazade with OpenType, run it with environment variable SAL_DISABLE_GRAPHITE=1.
Comment 9 QA Administrators 2016-09-20 09:33:31 UTC Comment hidden (obsolete)
Comment 10 ⁨خالد حسني⁩ 2016-09-21 07:37:11 UTC
Still an issue, should be fixed when bug 89870 is fixed.
Comment 11 Eyal Rozenberg 2024-09-17 20:13:03 UTC
Created attachment 196515 [details]
Subtending marks with LO 25.02 nightly - looks pretty bad

This is what I see with a recent nightly:

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e6be4ec010bd5e9fc15a423ad3c5ec39b07f305e
CPU threads: 4; OS: Linux 6.6; UI render: default; VCL: gtk3
Locale: en-IL (en_IL); UI: en-US
Calc: threaded

I don't know if it's a regression, or something is missing on my system, or what... I was hoping to verify this as fixed but am now wondering whether we need to reopen this?
Comment 12 Jonathan Clark 2024-09-17 23:21:30 UTC
(In reply to Eyal Rozenberg from comment #11)
> I don't know if it's a regression, or something is missing on my system, or
> what... I was hoping to verify this as fixed but am now wondering whether we
> need to reopen this?

The test document is clearly incorrect with Scheherazade, but if you switch to the updated Scheherazade New, it is rendered correctly. As such, this doesn't seem to be a general issue with subtending marks; LibreOffice can handle them correctly, at least sometimes.

I tested the original Scheherazade font with hb-view, and HarfBuzz does handle it correctly. There is some LibreOffice bug here.

We should either open a new issue for this, or reopen this bug and narrow the scope accordingly.
Comment 13 BobH 2024-09-19 12:30:06 UTC
If the text of the test document is copied to, for example, Notepad on Windows 10, both Scheherazade and Scheherazade New render it correctly (except that, for those fonts, some of the digit sequences in the test data are longer than are supported by the fonts.