Bug 478181 - Problem in rendering a specific Farsi/Arabic character combination
Summary: Problem in rendering a specific Farsi/Arabic character combination
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: font (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-06 20:55 UTC by Mohammad K.
Modified: 2024-04-24 22:57 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
A screenshot of the problem (223.97 KB, image/png)
2023-12-06 20:55 UTC, Mohammad K.
Details
where to enable the option (79.83 KB, image/png)
2023-12-06 22:29 UTC, ratijas
Details
Show the setting is enabled and have same issue (328.35 KB, image/png)
2023-12-07 02:02 UTC, Salem Yaslem
Details
Test after Lam-Alef fix patch (225.68 KB, video/webm)
2024-03-30 22:07 UTC, Mohammad K.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mohammad K. 2023-12-06 20:55:15 UTC
Created attachment 163954 [details]
A screenshot of the problem

SUMMARY
The problem is that Konsole can't render and show " لا " which is combination of " ل " and " ا " correctly.
It actually shows an extra space after it. Though, Kate (which uses Monospace font, too) shows it correct.

I've attached a screenshot of Konsole (Wrong) and Kate (Correct).

OBSERVED RESULT
The character after لا should come without any extra space

EXPECTED RESULT
After لا some extra space is rendered and shown.

SOFTWARE/OS VERSIONS

Konsole Version 23.08.3
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11
Kernel Version: 6.1.64-1-lts (64-bit)
Graphics Platform: Wayland

ADDITIONAL NOTES:

It used to be shown correctly is some versions ago (I don't exactly remember the version).
Comment 1 ratijas 2023-12-06 22:29:04 UTC
Created attachment 163959 [details]
where to enable the option

It works for me. Try enabling this option:

Edit current profile -> Appearance -> Complex Text Layout -> force LTR line direction.

It should be ON by default. Did you turn it off accidentally or on purpose?
Comment 2 ratijas 2023-12-06 22:53:15 UTC
Changing status of the bug report. (Bugzilla requires comment not be empty when doing so, and I forgot to change it when posting the first one)
Comment 3 Salem Yaslem 2023-12-07 02:02:15 UTC
Created attachment 163964 [details]
Show the setting is enabled and have same issue

I'm facing same issue even that option is enabled
Comment 4 Bug Janitor Service 2023-12-22 03:46:07 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Bug Janitor Service 2024-01-06 03:46:18 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!
Comment 6 Matan Ziv-Av 2024-03-30 16:01:55 UTC
This is the result of using ICU for shaping Arabic letters. This library shapes Lam (0x0644) + Alef (0x627) into a Lam-Alef ligature (0xfefc) and a space.

I wrote some code to undo this ligature.

If you know how to compile konsole, please test one of the branches: https://invent.kde.org/matan/konsole/-/tree/local-qt5 (for qt5), or https://invent.kde.org/matan/konsole/-/tree/lamalef (for qt6).
Comment 7 Mohammad K. 2024-03-30 22:06:12 UTC
(In reply to Matan Ziv-Av from comment #6)
> This is the result of using ICU for shaping Arabic letters. This library
> shapes Lam (0x0644) + Alef (0x627) into a Lam-Alef ligature (0xfefc) and a
> space.
> 
> I wrote some code to undo this ligature.
> 
> If you know how to compile konsole, please test one of the branches:
> https://invent.kde.org/matan/konsole/-/tree/local-qt5 (for qt5), or
> https://invent.kde.org/matan/konsole/-/tree/lamalef (for qt6).

Thanks! I just tested it and the issue looks be solved. 
The only problem is that, when a text contains Lam-Alef, emojis in that line of text are messed (Seems to happen only in those lines). 
I'll Attach a video to show the test.
Comment 8 Mohammad K. 2024-03-30 22:07:41 UTC
Created attachment 167962 [details]
Test after Lam-Alef fix patch
Comment 9 Matan Ziv-Av 2024-04-01 19:57:06 UTC
(In reply to Mohammad K. from comment #7)
> (In reply to Matan Ziv-Av from comment #6)
> > This is the result of using ICU for shaping Arabic letters. This library
> > shapes Lam (0x0644) + Alef (0x627) into a Lam-Alef ligature (0xfefc) and a
> > space.
> > 
> > I wrote some code to undo this ligature.
> > 
> > If you know how to compile konsole, please test one of the branches:
> > https://invent.kde.org/matan/konsole/-/tree/local-qt5 (for qt5), or
> > https://invent.kde.org/matan/konsole/-/tree/lamalef (for qt6).
> 
> Thanks! I just tested it and the issue looks be solved. 
> The only problem is that, when a text contains Lam-Alef, emojis in that line
> of text are messed (Seems to happen only in those lines). 
> I'll Attach a video to show the test.

I think I fixed it now. Please try again.
Comment 10 Mohammad K. 2024-04-02 11:59:53 UTC
(In reply to Matan Ziv-Av from comment #9)
> (In reply to Mohammad K. from comment #7)
> > (In reply to Matan Ziv-Av from comment #6)
> > > This is the result of using ICU for shaping Arabic letters. This library
> > > shapes Lam (0x0644) + Alef (0x627) into a Lam-Alef ligature (0xfefc) and a
> > > space.
> > > 
> > > I wrote some code to undo this ligature.
> > > 
> > > If you know how to compile konsole, please test one of the branches:
> > > https://invent.kde.org/matan/konsole/-/tree/local-qt5 (for qt5), or
> > > https://invent.kde.org/matan/konsole/-/tree/lamalef (for qt6).
> > 
> > Thanks! I just tested it and the issue looks be solved. 
> > The only problem is that, when a text contains Lam-Alef, emojis in that line
> > of text are messed (Seems to happen only in those lines). 
> > I'll Attach a video to show the test.
> 
> I think I fixed it now. Please try again.

I just tested it. It seems to working alright now! Thanks.
Comment 11 Bug Janitor Service 2024-04-23 21:07:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/989
Comment 12 Kurt Hindenburg 2024-04-24 22:57:27 UTC
Git commit 5f1fd57b50e7e3899ba682c021697b6a61194f76 by Kurt Hindenburg, on behalf of Matan Ziv-Av.
Committed on 24/04/2024 at 22:56.
Pushed by hindenburg into branch 'master'.

Don't use Lam-Alef ligatures when shaping arabic letters

ICU automatically shapes the two letters Lam and Alef to a single ligature,
so it is necessary to undo it.

M  +48   -1    src/terminalDisplay/TerminalDisplay.cpp

https://invent.kde.org/utilities/konsole/-/commit/5f1fd57b50e7e3899ba682c021697b6a61194f76