Bug 149022 - Different-color Arabic letters typeset as disconnected from each other
Summary: Different-color Arabic letters typeset as disconnected from each other
Status: RESOLVED DUPLICATE of bug 61444
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.3.3.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Arabic-and-Farsi
  Show dependency treegraph
 
Reported: 2022-05-10 20:30 UTC by Munzir Taha
Modified: 2022-08-31 22:04 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
shaping is broken in the .odt (9.45 KB, application/vnd.oasis.opendocument.text)
2022-05-10 20:30 UTC, Munzir Taha
Details
shaping is broken as shown in image (11.72 KB, image/png)
2022-05-10 20:31 UTC, Munzir Taha
Details
Screenshot showing parial shaping (39.27 KB, image/png)
2022-08-11 17:47 UTC, ⁨خالد حسني⁩
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Munzir Taha 2022-05-10 20:30:55 UTC
Created attachment 180047 [details]
shaping is broken in the .odt

In the attached document, the first line is how it should look, whereas in the second line, the shaping of two characters is broken.

If "Formatting Marks" are removed, only one character (LAM before ALEF) is broken.
Comment 1 Munzir Taha 2022-05-10 20:31:51 UTC
Created attachment 180048 [details]
shaping is broken as shown in image
Comment 2 Munzir Taha 2022-05-11 16:52:37 UTC
cc: Khaled Hosny, the expert in these matters. Not that he should fix it but his advice is always welcomed.
Comment 3 Eyal Rozenberg 2022-08-05 12:57:24 UTC
Confirmed. The letters with the different colors are made disconnected from their adjoining letters, and are thus typeset in their disconnected form.

Note, however, that within the colored sequence of letters, connection is maintained, i.e. if you add both-side-connectible letters (like خ) to the red part, they'll be connected amongst themselves, just not to the first post-red black letter (the ر).
Comment 4 ⁨خالد حسني⁩ 2022-08-11 17:47:12 UTC
Created attachment 181731 [details]
Screenshot showing parial shaping

I think there are multiple other bug reports for this same issue. Basically currently a color change amounts to a font change, so there is no interaction at the low level across the color change.

We try to handle this a bit more gracefully by passing the full text context to HarfBuzz even across font change to allow basic shaping (it would help with the خ here, but still break the لآ ligature), but I don’t know why it isn’t working for you, it works for me (using a different font).
Comment 5 Eyal Rozenberg 2022-08-11 18:32:22 UTC
(In reply to Khaled Hosny from comment #4)
> Created attachment 181731 [details]
> Screenshot showing parial shaping
> 
> I think there are multiple other bug reports for this same issue. Basically
> currently a color change amounts to a font change

And is this the Right Thing to do, in your opinion?
Comment 6 ⁨خالد حسني⁩ 2022-08-11 18:37:35 UTC
(In reply to Eyal Rozenberg from comment #5)
> (In reply to Khaled Hosny from comment #4)
> > Created attachment 181731 [details]
> > Screenshot showing parial shaping
> > 
> > I think there are multiple other bug reports for this same issue. Basically
> > currently a color change amounts to a font change
> 
> And is this the Right Thing to do, in your opinion?

No, it shouldn’t. But it is a big architectural change and I don’t even know what it entails. Instead of changing font on any style change, some style changes (like color, underline, font features, etc.) should be some kind of attribute applied to the text after shaping.

Very few application handle this right, though. Firefox and recent-ish Chrome do, and IIRC Microsoft Word also does.
Comment 7 ⁨خالد حسني⁩ 2022-08-31 22:04:34 UTC

*** This bug has been marked as a duplicate of bug 61444 ***