Bug 154104 - Arabic ligature overlaps previous neutral or RTL character
Summary: Arabic ligature overlaps previous neutral or RTL character
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Jonathan Clark
URL:
Whiteboard: target:26.2.0 target:25.8.0.0.beta2
Keywords:
Depends on:
Blocks: Arabic-and-Farsi Font-Fallback RTL CTL
  Show dependency treegraph
 
Reported: 2023-03-09 21:15 UTC by Eyal Rozenberg
Modified: 2025-06-30 12:34 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
arabic_and_hebrew_overlap (9.08 KB, application/vnd.oasis.opendocument.text)
2023-03-09 21:15 UTC, Eyal Rozenberg
Details
Document with just a quote character and a ligature (23.56 KB, application/vnd.oasis.opendocument.text-flat-xml)
2025-06-21 08:12 UTC, Eyal Rozenberg
Details
Document exhibiting the overlap with just a quote character and a ligature (23.47 KB, application/vnd.oasis.opendocument.text-flat-xml)
2025-06-21 08:21 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2023-03-09 21:15:53 UTC
Created attachment 185872 [details]
arabic_and_hebrew_overlap

Consider the following text:

אאאلا

if you type that into a new Writer document, with the RTL font being David CLM and marked as Hebrew - the لا combined character will overlap the third א, and the אאא sequence will be rendered with a left offset into the line, instead of at the beginning of the line.

This is actually a rather major fault in rendering of plain text.

Seen with:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ad387d5b984c6666906505d25685065f710ed55d
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: he-IL (en_IL); UI: en-US
Comment 1 Eyal Rozenberg 2023-03-09 21:16:56 UTC
May perhaps be related to 154029, via fallback-fonts and the effect of combined characters, I'm not sure.
Comment 2 Khaled Hosny 2023-03-18 17:59:55 UTC
I can reproduce. Would be interesting to know if it is a regression.
Comment 3 Khaled Hosny 2023-06-01 07:58:33 UTC
This seems to be related to font fallback, if the “Complex” font is set to a font that has Arabic, no overlap happens.
Comment 4 Eyal Rozenberg 2023-06-01 18:33:43 UTC
Khaled, do you think we should have a sub-meta-bug of Fonts, for Fallback-font-related issues?
Comment 5 Khaled Hosny 2023-06-04 13:49:54 UTC
(In reply to Eyal Rozenberg from comment #4)
> Khaled, do you think we should have a sub-meta-bug of Fonts, for
> Fallback-font-related issues?

It wouldn’t hurt, I guess.
Comment 6 Eyal Rozenberg 2024-08-19 11:01:32 UTC
Happens in textboxes and in Impress, doesn't seem to happen in Calc (although I've not checked extensively).
Comment 7 Eyal Rozenberg 2025-06-21 08:12:59 UTC Comment hidden (invalid, obsolete)
Comment 8 Eyal Rozenberg 2025-06-21 08:16:44 UTC
Comment on attachment 201394 [details]
Document with just a quote character and a ligature

Please excuse the comment added with this attachment, it was the result of a mis-copy-paste.

This document demonstrates the bug without any Hebrew text, just a quotation mark (a neutral character) and the ligature.
Comment 9 Eyal Rozenberg 2025-06-21 08:21:17 UTC
Created attachment 201395 [details]
Document exhibiting the overlap with just a quote character and a ligature

Apparently, the marking as Hebrew is not significant; I changed it to "ar" everywhere in the file, and dropped the country code.
Comment 10 Commit Notification 2025-06-26 08:53:02 UTC
Jonathan Clark committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/836880d49b5eace490d94a80ab6e7177a4413095

tdf#154104 Fix for overlapping chars in mixed-script fallback runs

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2025-06-26 17:10:01 UTC
Jonathan Clark committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/67b4d58544865dcc5f0fed5e55cec5967c747dab

tdf#154104 Fix for overlapping chars in mixed-script fallback runs

It will be available in 25.8.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Eyal Rozenberg 2025-06-27 06:30:43 UTC
(In reply to Commit Notification from comment #10)

Still seeing this with build:

Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e7201fd7c51743cb103bae82263d98830f5174cf
CPU threads: 4; OS: Linux 6.12; UI render: default; VCL: gtk3
Locale: en-IL (en_IL); UI: en-US

... and I can't tell whether the fix is supposed to be in, since the links to gitweb are dead.
Comment 13 Eyal Rozenberg 2025-06-30 12:34:37 UTC
I verify that the overlap is gone :-)