unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#48125: 28.0.50; Display garbled by emoji variation sequence
@ 2021-04-30 16:20 Filipp Gunbin
  2021-04-30 17:26 ` Filipp Gunbin
  2021-04-30 17:57 ` Eli Zaretskii
  0 siblings, 2 replies; 17+ messages in thread
From: Filipp Gunbin @ 2021-04-30 16:20 UTC (permalink / raw)
  To: 48125


emacs -Q

Enter a base emoji char and composing variation selector right after it:

C-x 8 RET SOCCER BALL
C-x 8 RET VARIATION SELECTOR-16

Then, for example:
C-a a s d f

And the display becomes garbled.

When auto-composition is turned off (M-x toggle-auto-composition),
everything is fine.

The above sequence is a real text which I got in an email header.  It
seems to be a valid variation sequence:

http://www.unicode.org/Public/emoji/5.0/emoji-variation-sequences.txt

...
26BD FE0E  ; text style;  # (5.2) SOCCER BALL
26BD FE0F  ; emoji style; # (5.2) SOCCER BALL
...

This is in tty emacs, built from latest master, on macOS.

Thanks.


In GNU Emacs 28.0.50 (build 4, x86_64-apple-darwin20.3.0, NS appkit-2022.30 Version 11.2.3 (Build 20D91))
 of 2021-04-30 built on fgunbin.local
System Description:  macOS 11.2.3

Configured features:
ACL GLIB GNUTLS LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG RSVG
THREADS TOOLKIT_SCROLL_BARS XIM ZLIB





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

* bug#48125: 28.0.50; Display garbled by emoji variation sequence
  2021-04-30 16:20 bug#48125: 28.0.50; Display garbled by emoji variation sequence Filipp Gunbin
@ 2021-04-30 17:26 ` Filipp Gunbin
  2021-04-30 18:01   ` Eli Zaretskii
  2021-04-30 17:57 ` Eli Zaretskii
  1 sibling, 1 reply; 17+ messages in thread
From: Filipp Gunbin @ 2021-04-30 17:26 UTC (permalink / raw)
  To: 48125

I'm using standard macOS Terminal app, with font DejaVu Sans Mono
(latest release 2.37 from 2016, see https://dejavu-fonts.github.io).

If I start gui Emacs with the same font, then the soccer ball doesn't
draw (C-u C-x = says "no font").

So Terminal must be using glyphs from somewhere else to draw the soccer
ball…  But how can I find out what exactly?





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

* bug#48125: 28.0.50; Display garbled by emoji variation sequence
  2021-04-30 16:20 bug#48125: 28.0.50; Display garbled by emoji variation sequence Filipp Gunbin
  2021-04-30 17:26 ` Filipp Gunbin
@ 2021-04-30 17:57 ` Eli Zaretskii
  2021-05-04 15:34   ` Filipp Gunbin
  1 sibling, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2021-04-30 17:57 UTC (permalink / raw)
  To: Filipp Gunbin; +Cc: 48125

> From: Filipp Gunbin <fgunbin@fastmail.fm>
> Date: Fri, 30 Apr 2021 19:20:12 +0300
> 
> emacs -Q
> 
> Enter a base emoji char and composing variation selector right after it:
> 
> C-x 8 RET SOCCER BALL
> C-x 8 RET VARIATION SELECTOR-16
> 
> Then, for example:
> C-a a s d f
> 
> And the display becomes garbled.

It isn't garbled here.

> This is in tty emacs, built from latest master, on macOS.

In TTY Emacs, the composition is handled by the terminal emulator.  So
I guess this bug should be reported to them.





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

* bug#48125: 28.0.50; Display garbled by emoji variation sequence
  2021-04-30 17:26 ` Filipp Gunbin
@ 2021-04-30 18:01   ` Eli Zaretskii
  2021-04-30 19:22     ` Filipp Gunbin
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2021-04-30 18:01 UTC (permalink / raw)
  To: Filipp Gunbin; +Cc: 48125

> From: Filipp Gunbin <fgunbin@fastmail.fm>
> Date: Fri, 30 Apr 2021 20:26:00 +0300
> 
> I'm using standard macOS Terminal app, with font DejaVu Sans Mono
> (latest release 2.37 from 2016, see https://dejavu-fonts.github.io).
> 
> If I start gui Emacs with the same font, then the soccer ball doesn't
> draw (C-u C-x = says "no font").
> 
> So Terminal must be using glyphs from somewhere else to draw the soccer
> ball…  But how can I find out what exactly?

Ask the Terminal's developers?





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

* bug#48125: 28.0.50; Display garbled by emoji variation sequence
  2021-04-30 18:01   ` Eli Zaretskii
@ 2021-04-30 19:22     ` Filipp Gunbin
  2021-05-02  7:21       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 17+ messages in thread
From: Filipp Gunbin @ 2021-04-30 19:22 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 48125

On 30/04/2021 21:01 +0300, Eli Zaretskii wrote:

>> From: Filipp Gunbin <fgunbin@fastmail.fm>
>> Date: Fri, 30 Apr 2021 20:26:00 +0300
>>
>> I'm using standard macOS Terminal app, with font DejaVu Sans Mono
>> (latest release 2.37 from 2016, see https://dejavu-fonts.github.io).
>>
>> If I start gui Emacs with the same font, then the soccer ball doesn't
>> draw (C-u C-x = says "no font").
>>
>> So Terminal must be using glyphs from somewhere else to draw the soccer
>> ball…  But how can I find out what exactly?
>
> Ask the Terminal's developers?

Looks like it uses the "Apple Color Emoji" font.

Yes, I should probably report the bug to Apple, so this may be closed.

Thanks.





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

* bug#48125: 28.0.50; Display garbled by emoji variation sequence
  2021-04-30 19:22     ` Filipp Gunbin
@ 2021-05-02  7:21       ` Lars Ingebrigtsen
  0 siblings, 0 replies; 17+ messages in thread
From: Lars Ingebrigtsen @ 2021-05-02  7:21 UTC (permalink / raw)
  To: 48125

Filipp Gunbin <fgunbin@fastmail.fm> writes:

> Yes, I should probably report the bug to Apple, so this may be closed.

OK; closing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#48125: 28.0.50; Display garbled by emoji variation sequence
  2021-04-30 17:57 ` Eli Zaretskii
@ 2021-05-04 15:34   ` Filipp Gunbin
  2021-05-04 16:05     ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Filipp Gunbin @ 2021-05-04 15:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 48125

On 30/04/2021 20:57 +0300, Eli Zaretskii wrote:

>> From: Filipp Gunbin <fgunbin@fastmail.fm>
>> Date: Fri, 30 Apr 2021 19:20:12 +0300
>> 
>> emacs -Q
>> 
>> Enter a base emoji char and composing variation selector right after it:
>> 
>> C-x 8 RET SOCCER BALL
>> C-x 8 RET VARIATION SELECTOR-16
>> 
>> Then, for example:
>> C-a a s d f
>> 
>> And the display becomes garbled.
>
> It isn't garbled here.
>
>> This is in tty emacs, built from latest master, on macOS.
>
> In TTY Emacs, the composition is handled by the terminal emulator.  So
> I guess this bug should be reported to them.

BTW, I see that emoji, as well as other characters from fonts different
from my selected one (Terminal has some font fallback logic), have
different width.  Is it ok for Emacs if a terminal emulator uses
different widths for different chars?





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

* bug#48125: 28.0.50; Display garbled by emoji variation sequence
  2021-05-04 15:34   ` Filipp Gunbin
@ 2021-05-04 16:05     ` Eli Zaretskii
  2021-05-04 16:20       ` Filipp Gunbin
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2021-05-04 16:05 UTC (permalink / raw)
  To: Filipp Gunbin; +Cc: 48125

> From: Filipp Gunbin <fgunbin@fastmail.fm>
> Cc: 48125@debbugs.gnu.org
> Date: Tue, 04 May 2021 18:34:09 +0300
> 
> BTW, I see that emoji, as well as other characters from fonts different
> from my selected one (Terminal has some font fallback logic), have
> different width.  Is it ok for Emacs if a terminal emulator uses
> different widths for different chars?

OK in what sense?  On TTY frames layout and rendering are left to the
terminal emulator; if it can handle this situation, Emacs won't care.





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

* bug#48125: 28.0.50; Display garbled by emoji variation sequence
  2021-05-04 16:05     ` Eli Zaretskii
@ 2021-05-04 16:20       ` Filipp Gunbin
  2021-05-04 16:51         ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Filipp Gunbin @ 2021-05-04 16:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 48125

On 04/05/2021 19:05 +0300, Eli Zaretskii wrote:

>> From: Filipp Gunbin <fgunbin@fastmail.fm>
>> Cc: 48125@debbugs.gnu.org
>> Date: Tue, 04 May 2021 18:34:09 +0300
>>
>> BTW, I see that emoji, as well as other characters from fonts different
>> from my selected one (Terminal has some font fallback logic), have
>> different width.  Is it ok for Emacs if a terminal emulator uses
>> different widths for different chars?
>
> OK in what sense?  On TTY frames layout and rendering are left to the
> terminal emulator; if it can handle this situation, Emacs won't care.

The effect of different widths is, of course, different number of chars
per line (easily seen in Terminal with emoji or Asian scripts).  Does
Emacs make assumptions about number of columns per line?  That's what I
meant.

Thanks.





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

* bug#48125: 28.0.50; Display garbled by emoji variation sequence
  2021-05-04 16:20       ` Filipp Gunbin
@ 2021-05-04 16:51         ` Eli Zaretskii
  2021-05-04 19:06           ` Filipp Gunbin
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2021-05-04 16:51 UTC (permalink / raw)
  To: Filipp Gunbin; +Cc: 48125

> From: Filipp Gunbin <fgunbin@fastmail.fm>
> Cc: 48125@debbugs.gnu.org
> Date: Tue, 04 May 2021 19:20:27 +0300
> 
> > OK in what sense?  On TTY frames layout and rendering are left to the
> > terminal emulator; if it can handle this situation, Emacs won't care.
> 
> The effect of different widths is, of course, different number of chars
> per line (easily seen in Terminal with emoji or Asian scripts).  Does
> Emacs make assumptions about number of columns per line?

It does, but the number of columns doesn't change, only the width
changes.  Right?

What Emacs expects is that the terminal emulator will space characters
according to the width in columns (either 1 or 2) of each character,
as defined in the Unicode Character database.  You can see what Emacs
thinks about the width of each character by using 'char-width'.
AFAIR, all emoji should have width of 2, is that right?





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

* bug#48125: 28.0.50; Display garbled by emoji variation sequence
  2021-05-04 16:51         ` Eli Zaretskii
@ 2021-05-04 19:06           ` Filipp Gunbin
  2021-05-04 19:17             ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Filipp Gunbin @ 2021-05-04 19:06 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 48125

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

On 04/05/2021 19:51 +0300, Eli Zaretskii wrote:

>> From: Filipp Gunbin <fgunbin@fastmail.fm>
>> Cc: 48125@debbugs.gnu.org
>> Date: Tue, 04 May 2021 19:20:27 +0300
>>
>> > OK in what sense?  On TTY frames layout and rendering are left to the
>> > terminal emulator; if it can handle this situation, Emacs won't care.
>>
>> The effect of different widths is, of course, different number of chars
>> per line (easily seen in Terminal with emoji or Asian scripts).  Does
>> Emacs make assumptions about number of columns per line?
>
> It does, but the number of columns doesn't change, only the width
> changes.  Right?
>
> What Emacs expects is that the terminal emulator will space characters
> according to the width in columns (either 1 or 2) of each character,
> as defined in the Unicode Character database.  You can see what Emacs
> thinks about the width of each character by using 'char-width'.
> AFAIR, all emoji should have width of 2, is that right?

I see now!

One more question.  In the attached screenshot there're two lines, one
with soccer balls (width 2), and another with letter "a" (width 1).
Both do not fit on screen, and are continued to the next (screen) line.
When at EOL of either, C-x = reports column=142, but the first is longer
(by 1 column).  That is because it's continued with two backslashes, not
one.  Is this the right behavior?


[-- Attachment #2: Screenshot 2021-05-04 at 21.55.48.png --]
[-- Type: image/png, Size: 19249 bytes --]

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

* bug#48125: 28.0.50; Display garbled by emoji variation sequence
  2021-05-04 19:06           ` Filipp Gunbin
@ 2021-05-04 19:17             ` Eli Zaretskii
  2021-05-04 19:29               ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2021-05-04 19:17 UTC (permalink / raw)
  To: Filipp Gunbin; +Cc: 48125

> From: Filipp Gunbin <fgunbin@fastmail.fm>
> Cc: 48125@debbugs.gnu.org
> Date: Tue, 04 May 2021 22:06:36 +0300
> 
> One more question.  In the attached screenshot there're two lines, one
> with soccer balls (width 2), and another with letter "a" (width 1).
> Both do not fit on screen, and are continued to the next (screen) line.
> When at EOL of either, C-x = reports column=142, but the first is longer
> (by 1 column).  That is because it's continued with two backslashes, not
> one.  Is this the right behavior?

I don't see the continuation backslashes in the screenshot, but from
your description the behavior sounds right.  There could even be more
than 2 backslashes in some rare cases.





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

* bug#48125: 28.0.50; Display garbled by emoji variation sequence
  2021-05-04 19:17             ` Eli Zaretskii
@ 2021-05-04 19:29               ` Eli Zaretskii
  2021-05-04 20:36                 ` Filipp Gunbin
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2021-05-04 19:29 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: fgunbin, 48125

> Date: Tue, 04 May 2021 22:17:18 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 48125@debbugs.gnu.org
> 
> > From: Filipp Gunbin <fgunbin@fastmail.fm>
> > Cc: 48125@debbugs.gnu.org
> > Date: Tue, 04 May 2021 22:06:36 +0300
> > 
> > One more question.  In the attached screenshot there're two lines, one
> > with soccer balls (width 2), and another with letter "a" (width 1).
> > Both do not fit on screen, and are continued to the next (screen) line.
> > When at EOL of either, C-x = reports column=142, but the first is longer
> > (by 1 column).  That is because it's continued with two backslashes, not
> > one.  Is this the right behavior?
> 
> I don't see the continuation backslashes in the screenshot, but from
> your description the behavior sounds right.  There could even be more
> than 2 backslashes in some rare cases.

Oh, and of course the backslashes aren't counted as part of the column
number, only the displayed text is counted.





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

* bug#48125: 28.0.50; Display garbled by emoji variation sequence
  2021-05-04 19:29               ` Eli Zaretskii
@ 2021-05-04 20:36                 ` Filipp Gunbin
  2021-05-05 11:49                   ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Filipp Gunbin @ 2021-05-04 20:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 48125

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

On 04/05/2021 22:29 +0300, Eli Zaretskii wrote:

>> Date: Tue, 04 May 2021 22:17:18 +0300
>> From: Eli Zaretskii <eliz@gnu.org>
>> Cc: 48125@debbugs.gnu.org
>>
>> > From: Filipp Gunbin <fgunbin@fastmail.fm>
>> > Cc: 48125@debbugs.gnu.org
>> > Date: Tue, 04 May 2021 22:06:36 +0300
>> >
>> > One more question.  In the attached screenshot there're two lines, one
>> > with soccer balls (width 2), and another with letter "a" (width 1).
>> > Both do not fit on screen, and are continued to the next (screen) line.
>> > When at EOL of either, C-x = reports column=142, but the first is longer
>> > (by 1 column).  That is because it's continued with two backslashes, not
>> > one.  Is this the right behavior?
>>
>> I don't see the continuation backslashes in the screenshot, but from
>> your description the behavior sounds right.  There could even be more
>> than 2 backslashes in some rare cases.
>
> Oh, and of course the backslashes aren't counted as part of the column
> number, only the displayed text is counted.

Re-checked - they should be visible in the screenshot (maybe you didn't
scroll the image to the right?)

Ok, I have two continuation backslashes in the end of the screen line
with soccer balls.  But what I wanted to note is that on continuation
lines, I get equal column numbers at different screen positions.

I've now made two screenshots with point at each EOL, to show that
screen positions are different.


[-- Attachment #2: Screenshot 2021-05-04 at 23.30.07.png --]
[-- Type: image/png, Size: 97214 bytes --]

[-- Attachment #3: Screenshot 2021-05-04 at 23.30.18.png --]
[-- Type: image/png, Size: 99059 bytes --]

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

* bug#48125: 28.0.50; Display garbled by emoji variation sequence
  2021-05-04 20:36                 ` Filipp Gunbin
@ 2021-05-05 11:49                   ` Eli Zaretskii
  2021-05-05 13:41                     ` Filipp Gunbin
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2021-05-05 11:49 UTC (permalink / raw)
  To: Filipp Gunbin; +Cc: 48125

> From: Filipp Gunbin <fgunbin@fastmail.fm>
> Cc: 48125@debbugs.gnu.org
> Date: Tue, 04 May 2021 23:36:19 +0300
> 
> Ok, I have two continuation backslashes in the end of the screen line
> with soccer balls.  But what I wanted to note is that on continuation
> lines, I get equal column numbers at different screen positions.
> 
> I've now made two screenshots with point at each EOL, to show that
> screen positions are different.

OK, but what is the point you want to make?  current-column doesn't
measure screen coordinates, it measures the sum of character-widths.
A single-width character increments the column count by 1, a
double-width character increments it by 2.  Given this fact, is there
something wrong that you see with the reported column in each case?





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

* bug#48125: 28.0.50; Display garbled by emoji variation sequence
  2021-05-05 11:49                   ` Eli Zaretskii
@ 2021-05-05 13:41                     ` Filipp Gunbin
  2021-05-05 14:05                       ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Filipp Gunbin @ 2021-05-05 13:41 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 48125

On 05/05/2021 14:49 +0300, Eli Zaretskii wrote:

>> From: Filipp Gunbin <fgunbin@fastmail.fm>
>> Cc: 48125@debbugs.gnu.org
>> Date: Tue, 04 May 2021 23:36:19 +0300
>>
>> Ok, I have two continuation backslashes in the end of the screen line
>> with soccer balls.  But what I wanted to note is that on continuation
>> lines, I get equal column numbers at different screen positions.
>>
>> I've now made two screenshots with point at each EOL, to show that
>> screen positions are different.
>
> OK, but what is the point you want to make?  current-column doesn't
> measure screen coordinates, it measures the sum of character-widths.
> A single-width character increments the column count by 1, a
> double-width character increments it by 2.  Given this fact, is there
> something wrong that you see with the reported column in each case?

I wanted to confirm that this all is ok, now you say just that, thanks.

For the record, from what I can see, Terminal has problems when
composing 2-column chars with that VARIATION SELECTOR-16 (and maybe
others).

Filipp





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

* bug#48125: 28.0.50; Display garbled by emoji variation sequence
  2021-05-05 13:41                     ` Filipp Gunbin
@ 2021-05-05 14:05                       ` Eli Zaretskii
  0 siblings, 0 replies; 17+ messages in thread
From: Eli Zaretskii @ 2021-05-05 14:05 UTC (permalink / raw)
  To: Filipp Gunbin; +Cc: 48125

> From: Filipp Gunbin <fgunbin@fastmail.fm>
> Cc: 48125@debbugs.gnu.org
> Date: Wed, 05 May 2021 16:41:19 +0300
> 
> For the record, from what I can see, Terminal has problems when
> composing 2-column chars with that VARIATION SELECTOR-16 (and maybe
> others).

Yes, well.  Emacs doesn't yet support variation selectors, either.





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

end of thread, other threads:[~2021-05-05 14:05 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-30 16:20 bug#48125: 28.0.50; Display garbled by emoji variation sequence Filipp Gunbin
2021-04-30 17:26 ` Filipp Gunbin
2021-04-30 18:01   ` Eli Zaretskii
2021-04-30 19:22     ` Filipp Gunbin
2021-05-02  7:21       ` Lars Ingebrigtsen
2021-04-30 17:57 ` Eli Zaretskii
2021-05-04 15:34   ` Filipp Gunbin
2021-05-04 16:05     ` Eli Zaretskii
2021-05-04 16:20       ` Filipp Gunbin
2021-05-04 16:51         ` Eli Zaretskii
2021-05-04 19:06           ` Filipp Gunbin
2021-05-04 19:17             ` Eli Zaretskii
2021-05-04 19:29               ` Eli Zaretskii
2021-05-04 20:36                 ` Filipp Gunbin
2021-05-05 11:49                   ` Eli Zaretskii
2021-05-05 13:41                     ` Filipp Gunbin
2021-05-05 14:05                       ` Eli Zaretskii

unofficial mirror of bug-gnu-emacs@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/emacs-bugs/0 emacs-bugs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 emacs-bugs emacs-bugs/ https://yhetil.org/emacs-bugs \
		bug-gnu-emacs@gnu.org
	public-inbox-index emacs-bugs

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.bugs
	nntp://news.gmane.io/gmane.emacs.bugs


code repositories for project(s) associated with this inbox:

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

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git