all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mike FABIAN <mfabian@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: rpluim@gmail.com, 39799@debbugs.gnu.org
Subject: bug#39799: 28.0.50; Most emoji sequences don’t render correctly
Date: Sat, 29 Feb 2020 12:14:28 +0100	[thread overview]
Message-ID: <s9d8skly7aj.fsf@taka.site> (raw)
In-Reply-To: <83k145emk9.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 29 Feb 2020 12:04:54 +0200")

Eli Zaretskii <eliz@gnu.org> さんはかきました:

>> From: Mike FABIAN <mfabian@redhat.com>
>> Cc: rpluim@gmail.com,  39799@debbugs.gnu.org
>> Date: Sat, 29 Feb 2020 08:59:49 +0100
>> 
>> Eli Zaretskii <eliz@gnu.org> さんはかきました:
>> 
>> > If Gedit selects a font by looking at more than one codepoint (and I'm
>> > not sure this is how it works in Gedit), then Emacs doesn't work that
>> > way.
>> 
>> Yes, Gedit does this somehow with pango. It tries to avoid switching
>> fonts in places where it would look bad. For example, if you have a
>> default font supporting only ASCII and then there is a word containing
>> some non-ASCII character like “grün” it chooses a font containing the
>> “ü” for the whole word to avoid the “ü” looking out of place.
>
> Well, "somehow" is not enough to see whether we have any additional
> work to do in Emacs, because Emacs also tries to achieve that same
> goal.  There are many different ways to achieve it, though; for
> example, Emacs will AFAIK by default not even use a font that could
> support ASCII, but not Latin-1 blocks as the default face's font.
>
> What you say about Gedit makes sense in general, but questions
> immediately pop up: how does Gedit define a "word" (Emacs, as you
> know, has very a flexible definition that can be controlled from
> Lisp), how does it "know" that a word like "grün" belongs to the same
> script (otherwise displaying a character from another script using a
> different font, as in, say, "grאn" might make sense), etc.

Yes, “word” is already too simplified.


> IOW, what we need is a detailed description of what Pango does here,
> and how does Gedit affect that by configuring its default fonts.  Only
> then we can reason about the differences between that and what Emacs
> does.

Yes, you are right, and I think this is very difficult.

I don’t know the details, but Pango seems to “cut” text into “runs”
where each “run” is rendered with a single font. And it tries to
cut the text into “runs” in a way that the overall result looks
as nice as possible. This is really difficult and doesn’t always
work well, sometimes the results are ugly although overall it seems to
do a good job.

>> > In any case, are these sequences displayed as composed characters?
>> > Does "C-u C-x =" tell that the base character U+24C2 was composed with
>> > the following variation selector?  According to the setup in
>> > japanese.el, they should compose, if the font used for U+24C2 also
>> > supports the variation selectors.
>> 
>> Yes, it does tell that it was composed with the following character:
>
> And the resulting display is what you expect?  If not, then I think
> you need to find a font which supports Emoji presentation of
> characters such as Ⓜ, and make Emacs use it for those sequences.

Yes, in the case of Ⓜ️ U+24C2 U+FE0F the result in Emacs is perfect
when using “Noto Color Emoji” or “Joypixels”. It is displayed in colour
and behaves as a single character in the buffer, the variation selector
is not displayed as a box. This is perfect.

But when using Symbola for the same sequence one sees U+FE0F as an ugly
box.

And when displaying the text representation sequence Ⓜ︎ U+24C2 U+FE0E
one always sees U+FE0E as a box no matter whether using “Symbola”,
“Noto Color Emoji” or “Joypixels”.

I am not sure whether this is wrong. Maybe it is OK to require a font
which can handle this? I am really not sure...

But what about # U+0023 NUMBER SIGN ?

This does have an emoji representation.

I.e. U+0023 U+FE0F displays in color as an emoji in pango-view and
gedit.

How could this ever work in Emacs? If you have to decide for a single
font to render U+0023 in Emacs, you would need to set a “capable” emoji
font for an ASCII character like #. One probably does not want to do
that. Then # in text representation would look different in style than
the other ASCII characters because it would come as the text
representation glyph from some emoji font which would probably not go
well together with other ASCII characters coming from some font like
for example “DejaVu Sans Mono”. So one probably wants to set
something like “DejaVu Sans Mono” for # as well, otherwise normal text
won’t look nice. But how can one display U+0023 U+FE0F as am emoji then?

This seems very messy, I don’t know how this can be solved.

> If you think this Emacs requirement for a capable font is incorrect, I
> suggest to post a question about this to the HarfBuzz mailing list,
> harfbuzz@lists.freedesktop.org, maybe HarfBuzz has capabilities in
> this regard that we somehow don't yet utilize.

Yes, I’ll try that, maybe that helps to understand it better.

-- 
Mike FABIAN <mfabian@redhat.com>
睡眠不足はいい仕事の敵だ。






  reply	other threads:[~2020-02-29 11:14 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 14:28 bug#39799: 28.0.50; Most emoji sequences don’t render correctly Mike FABIAN
2020-02-28  7:14 ` Eli Zaretskii
2020-02-28  7:36   ` Mike FABIAN
2020-02-28  8:25     ` Eli Zaretskii
2020-02-28 12:21       ` Robert Pluim
2020-02-28 12:46         ` Mike FABIAN
2020-02-28 13:19           ` Robert Pluim
2020-02-28 13:50             ` Mike FABIAN
2020-02-28 13:56               ` Eli Zaretskii
2020-02-28 14:44                 ` Mike FABIAN
2020-02-28 13:08         ` Eli Zaretskii
2020-02-28 13:47           ` Mike FABIAN
2020-02-28 13:54             ` Eli Zaretskii
2020-02-28 14:14           ` Robert Pluim
2020-02-28 14:45             ` Eli Zaretskii
2020-02-28 15:32               ` Mike FABIAN
2020-02-28 15:57                 ` Robert Pluim
2020-02-28 15:39               ` Robert Pluim
2020-02-28 16:38                 ` Mike FABIAN
2020-02-28 14:46             ` Eli Zaretskii
2020-02-28 15:35               ` Robert Pluim
2020-02-28 15:44                 ` Eli Zaretskii
2020-02-28 16:24                   ` Robert Pluim
2020-02-28 17:30                     ` Mike FABIAN
2020-02-28 17:55                       ` Mike FABIAN
2020-02-28 18:01                       ` Robert Pluim
2020-02-28 19:29                         ` Mike FABIAN
2020-02-28 19:34                         ` Mike FABIAN
2020-02-28 21:32                         ` Mike FABIAN
2020-02-28 21:38                           ` Robert Pluim
2020-02-28 20:21                       ` Eli Zaretskii
2020-02-28 20:25                         ` Eli Zaretskii
2020-02-28 21:02                           ` Eli Zaretskii
2020-02-28 21:47                             ` Robert Pluim
2020-02-28 22:07                               ` Eli Zaretskii
2020-02-29  7:50                                 ` Mike FABIAN
2020-02-29  9:40                                   ` Eli Zaretskii
2020-02-29 10:45                                     ` Mike FABIAN
2020-02-28 21:10                         ` Mike FABIAN
2020-02-28 21:49                           ` Eli Zaretskii
2020-02-29  7:59                             ` Mike FABIAN
2020-02-29 10:04                               ` Eli Zaretskii
2020-02-29 11:14                                 ` Mike FABIAN [this message]
2020-02-29 11:52                                   ` Eli Zaretskii
2020-02-29 16:59                                     ` Mike FABIAN
2020-02-28 20:13                     ` Eli Zaretskii
2020-02-28 20:38                       ` Robert Pluim
2020-02-28 20:55                         ` Eli Zaretskii
2020-02-28 21:22                           ` Robert Pluim
2020-02-28 21:27                             ` Mike FABIAN
2020-02-28 21:52                             ` Eli Zaretskii
2020-02-29  8:01                               ` Mike FABIAN
2020-02-29  9:49                                 ` Eli Zaretskii
2020-02-29 10:26                                   ` Mike FABIAN
2020-02-29 11:19                                     ` Eli Zaretskii
2020-02-29 11:36                                       ` Mike FABIAN
2020-02-29 11:58                                         ` Eli Zaretskii
2020-02-29 17:03                                           ` Mike FABIAN
2020-02-29 17:19                                             ` Eli Zaretskii
2020-02-29 11:41                                       ` Mike FABIAN
2020-02-29 12:02                                         ` Eli Zaretskii
2020-02-29 17:14                                           ` Mike FABIAN
2020-02-29 17:27                                             ` Eli Zaretskii
2020-03-02  9:10                                               ` Robert Pluim
2020-03-02 11:02                                                 ` Eli Zaretskii
2020-02-28 21:14                         ` Mike FABIAN
2020-02-28 21:50                           ` Eli Zaretskii
2020-02-28 16:19             ` Eli Zaretskii
2020-02-28 16:39               ` Robert Pluim
2020-02-28 20:16                 ` Eli Zaretskii
2020-02-28 20:56                   ` Robert Pluim
2021-09-20 20:38                     ` Robert Pluim
2021-09-21  9:16                       ` Eli Zaretskii
2021-09-21 10:34                         ` Robert Pluim
2021-09-21 10:54                           ` Eli Zaretskii
2021-09-21 11:31                             ` Eli Zaretskii
2021-09-21 17:43                               ` Robert Pluim
2021-09-21 18:28                                 ` Eli Zaretskii
2021-09-22  9:02                                   ` Robert Pluim
2021-09-24 19:28                                     ` Mike FABIAN
2021-09-25  5:55                                       ` Eli Zaretskii
2021-09-25  7:35                                         ` Mike FABIAN
2021-09-25  9:19                                           ` Eli Zaretskii
2021-11-06 18:59                                             ` Lars Ingebrigtsen
2021-09-21 11:48                       ` Mike FABIAN
2021-09-21 11:58                         ` Eli Zaretskii
2021-09-21 12:27                           ` Mike FABIAN
2021-09-21 12:37                             ` Eli Zaretskii
2021-09-21 12:50                           ` Robert Pluim
2021-09-21 13:06                             ` Eli Zaretskii
2021-09-21 13:25                               ` Mike FABIAN
2021-09-21 13:53                                 ` Robert Pluim
2021-09-21 14:19                                   ` Eli Zaretskii
2021-09-21 14:43                                     ` Robert Pluim
2021-09-21 15:58                                       ` Eli Zaretskii
2021-09-21 16:10                                         ` Robert Pluim
2021-09-21 16:23                                           ` Eli Zaretskii
2021-09-21 16:50                                             ` Eli Zaretskii
2021-09-21 18:20                                               ` Eli Zaretskii
2021-09-22  8:59                                                 ` Robert Pluim
2021-09-22 13:47                                                   ` Eli Zaretskii
2021-09-24 11:41                                                 ` Robert Pluim
2021-09-24 12:04                                                   ` Eli Zaretskii
2021-09-24 12:10                                                     ` Robert Pluim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s9d8skly7aj.fsf@taka.site \
    --to=mfabian@redhat.com \
    --cc=39799@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=rpluim@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.