Subject: Re: bug#77916: Unicode Variation Selector 15 ignored by emacs GTK and honoured by emacs -nw

From: Eli Zaretskii <[email-masked]>
Date: Sat, 19 Apr 2025 11:08:56 +0300

> From: Дилян Палаузов
>  <[email-masked]>
> Date: Sat, 19 Apr 2025 09:15:31 +0300
> 
> I load https://cal.aegee.org/s/0/e947872a-224b-4c84-8d25-90a541a9ec6-318.ics_en.html using emacs eww.  The file contains on the When line the Unicode Clock Face Twelve O’clock emoji followed by Unicode Variation Selector 15, which means that the clock must be presented in text mode (without colour).
> 
> I use emacs 29.4 (GTK+ Version 3.24.43, cairo 1.18.2) and `emacs -nw'.
> 
> emacs -nw eww shows the 12 O’clock emoji in text mode.  At the same time emacs GTK shows the clock in colour mode.

I believe these differences are due to the fonts used by the
respective Emacs sessions (the -nw session uses the font of the
terminal emulator).  The result of combining an emoji with VS-15
depends on the font.  Also, is your Emacs built with HarfBuzz as the
shaping engine?  You haven't shown the data collected by
report-emacs-bug, which includes the details of your build.

> emacs -nw eww shows <h1><span data-nosnippet style='background-color:#ffd700;color:#000;display:block;padding:0 .5rem'>NWM: Pescara, the next treasure island🏝️ !</span></h1> with a black hole after the island emoji, while emacs GTK does not show that black hole.

That "black hole" is probably the result of not combining the island
emoji with the following VS-16 control, perhaps again an issue with
the font and/or the terminal emulator you are using.  Or maybe it's
something related to the character width on display?

FTR, I see no such problems on my system, neither in Emacs 29 nor in
the current development version of Emacs 31.  But my build is not a
GTK build, and it does use HarfBuzz in the GUI frames.  For the -nw
session, I tried PuTTY, and didn't see any "black holes".

> If I move the file as-is in a different domain, emacs -nw inserts after the hyperlinks behind “Link to calendar” and “iCalendar file” an exclamation mark.  emacs GTK also puts behind the same hyperlinks an exclamation mark and the hyperlinks on their own are with blue colour on red background.  This has bad contrast and is hard perceive.

Can you please describe the detailed steps for "move the file as-is in
a different domain"?  I don't understand what that means, so couldn't
try reproducing this.

> So:
> • the clock in not in text mode in emacs GTK, but in text mode in emacs -nw? (Likewise for the globe on the next line).  N.B. Epiphany (WebKitGTK does the same for the clock - cf. https://bugs.webkit.org/show_bug.cgi?id=290996 , contrary to Firefor or Chromium on Linux.  WebKitGTK/Epiphany however render the island emoji in text mode, which emacs GTK, emacs -nw, Firefox and Chromium do not do.)
> • emacs GTK shows the two hyperlinks in bad contrast (red background, blue text)
> * Why the exclamation mark after the URLs?
> * Can the black hole after the island emoji be avoided in emacs -nw?

Most probably, problems related to the fonts being used.