unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44632: 27.1.50; Left-to-right Arabic shaping breaks at property bounds
@ 2020-11-14 12:42 Thamer Mahmoud
  2020-11-14 14:51 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Thamer Mahmoud @ 2020-11-14 12:42 UTC (permalink / raw)
  To: 44632

This also affects overlays and `transient-mark-mode' region.

1. Eval:

(with-current-buffer-window "*shaping testcase*" nil nil
  (insert "L2R عربي" "\n\n")
  (insert "عربي")
  (put-text-property 5 6 'face 'highlight)
  (put-text-property 11 12 'face 'highlight))

2. Notice the AIN(ع) in the L2R paragraph has the wrong shape.

--
Regards,
Thamer





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#44632: 27.1.50; Left-to-right Arabic shaping breaks at property bounds
  2020-11-14 12:42 bug#44632: 27.1.50; Left-to-right Arabic shaping breaks at property bounds Thamer Mahmoud
@ 2020-11-14 14:51 ` Eli Zaretskii
  2020-11-22 16:58   ` Thamer Mahmoud
  2021-10-11 12:36   ` Stefan Kangas
  0 siblings, 2 replies; 5+ messages in thread
From: Eli Zaretskii @ 2020-11-14 14:51 UTC (permalink / raw)
  To: Thamer Mahmoud; +Cc: 44632

> From: Thamer Mahmoud <thamer.mahmoud@gmail.com>
> Date: Sat, 14 Nov 2020 15:42:35 +0300
> 
> (with-current-buffer-window "*shaping testcase*" nil nil
>   (insert "L2R عربي" "\n\n")
>   (insert "عربي")
>   (put-text-property 5 6 'face 'highlight)
>   (put-text-property 11 12 'face 'highlight))
> 
> 2. Notice the AIN(ع) in the L2R paragraph has the wrong shape.

This is a known limitation of the current Emacs display engine: it
cannot shape text across face changes.  All the text that needs to be
shaped must have the same face.  This problem has existed since Emacs
21.

Fixing this limitation would require a more or less complete redesign
of how the display engine scans the buffer text, or maybe some radical
changes in how character composition is handled.  Until one of these
changes, this problem will remain unsolved, sorry.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#44632: 27.1.50; Left-to-right Arabic shaping breaks at property bounds
  2020-11-14 14:51 ` Eli Zaretskii
@ 2020-11-22 16:58   ` Thamer Mahmoud
  2020-11-22 18:19     ` Eli Zaretskii
  2021-10-11 12:36   ` Stefan Kangas
  1 sibling, 1 reply; 5+ messages in thread
From: Thamer Mahmoud @ 2020-11-22 16:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 44632

[-- Attachment #1: Type: text/plain, Size: 1046 bytes --]


Eli Zaretskii <eliz@gnu.org> writes:

>> From: Thamer Mahmoud <thamer.mahmoud@gmail.com>
>> Date: Sat, 14 Nov 2020 15:42:35 +0300
>>
>> (with-current-buffer-window "*shaping testcase*" nil nil
>>   (insert "L2R عربي" "\n\n")
>>   (insert "عربي")
>>   (put-text-property 5 6 'face 'highlight)
>>   (put-text-property 11 12 'face 'highlight))
>>
>> 2. Notice the AIN(ع) in the L2R paragraph has the wrong shape.
>
> This is a known limitation of the current Emacs display engine: it
> cannot shape text across face changes.  All the text that needs to be
> shaped must have the same face.  This problem has existed since Emacs
> 21.
>
> Fixing this limitation would require a more or less complete redesign
> of how the display engine scans the buffer text, or maybe some radical
> changes in how character composition is handled.  Until one of these
> changes, this problem will remain unsolved, sorry.

Shaping across face changes works for me in R2L paragraphs, but not in
L2R. See the attached screenshot.


[-- Attachment #2: shaping --]
[-- Type: image/png, Size: 9578 bytes --]

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]



Wouldn't it be possible to extend the same behavior that is currently
working fine in R2L paragraphs to also apply to L2R ones?

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#44632: 27.1.50; Left-to-right Arabic shaping breaks at property bounds
  2020-11-22 16:58   ` Thamer Mahmoud
@ 2020-11-22 18:19     ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2020-11-22 18:19 UTC (permalink / raw)
  To: Thamer Mahmoud; +Cc: 44632

> From: Thamer Mahmoud <thamer.mahmoud@gmail.com>
> Cc: 44632@debbugs.gnu.org
> Date: Sun, 22 Nov 2020 19:58:03 +0300
> 
> Wouldn't it be possible to extend the same behavior that is currently
> working fine in R2L paragraphs to also apply to L2R ones?

Sorry, no.  Not without serious changes (basically, a redesign) in the
low-level code that iterates the buffer for rendering characters for
display.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#44632: 27.1.50; Left-to-right Arabic shaping breaks at property bounds
  2020-11-14 14:51 ` Eli Zaretskii
  2020-11-22 16:58   ` Thamer Mahmoud
@ 2021-10-11 12:36   ` Stefan Kangas
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Kangas @ 2021-10-11 12:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 44632, Thamer Mahmoud

tags 44632 + wontfix
close 44632
thanks

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Thamer Mahmoud <thamer.mahmoud@gmail.com>
>> Date: Sat, 14 Nov 2020 15:42:35 +0300
>>
>> (with-current-buffer-window "*shaping testcase*" nil nil
>>   (insert "L2R عربي" "\n\n")
>>   (insert "عربي")
>>   (put-text-property 5 6 'face 'highlight)
>>   (put-text-property 11 12 'face 'highlight))
>>
>> 2. Notice the AIN(ع) in the L2R paragraph has the wrong shape.
>
> This is a known limitation of the current Emacs display engine: it
> cannot shape text across face changes.  All the text that needs to be
> shaped must have the same face.  This problem has existed since Emacs
> 21.
>
> Fixing this limitation would require a more or less complete redesign
> of how the display engine scans the buffer text, or maybe some radical
> changes in how character composition is handled.  Until one of these
> changes, this problem will remain unsolved, sorry.

Since this is a known limitation, I think it unfortunately doesn't make
sense to keep this bug open.  If anyone wants to work on a redesign of
the display engine, they will probably not do that due to this bug.

I guess it would be good if we could have a list somewhere of the known
limitations, so if anyone knows about something like that please add it.

But for now, I'm closing this as wontfix.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-11 12:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-14 12:42 bug#44632: 27.1.50; Left-to-right Arabic shaping breaks at property bounds Thamer Mahmoud
2020-11-14 14:51 ` Eli Zaretskii
2020-11-22 16:58   ` Thamer Mahmoud
2020-11-22 18:19     ` Eli Zaretskii
2021-10-11 12:36   ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).