bug#44020: 28.0.50; Prefer selection of colour emoji fonts?

classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|

bug#44020: 28.0.50; Prefer selection of colour emoji fonts?

Robert Pluim
>>>>> On Sat, 17 Oct 2020 09:44:44 +0300, Eli Zaretskii <[hidden email]> said:

    >> Date: Fri, 16 Oct 2020 20:30:41 +0100
    >> From: Alan Third <[hidden email]>
    >> Cc: Eli Zaretskii <[hidden email]>, [hidden email], [hidden email]
    >>
    >> On Fri, Oct 16, 2020 at 12:38:18PM +0200, Robert Pluim wrote:
    >> > >>>>> On Fri, 16 Oct 2020 13:26:42 +0300, Eli Zaretskii <[hidden email]> said:
    >> >
    >> >     Eli> Also, Noto Color Emoji has a free license, so it's okay for it to be
    >> >     Eli> in fontset.el, but it is not clear to me whether Apple Color Emoji is
    >> >     Eli> distributed under a free license.
    >> >
    >> > It始s marked 'Copyright Apple 2011-2016' in the macOS font
    >> > selector. And Apple appear to be both sensitive and litigious about
    >> > it, so probably best not to promote it.
    >>
    >> On the other hand it comes preinstalled, it only works on Apple
    >> devices, and Noto Color Emoji doesn't work on Apple devices. I'm not
    >> sure we'd really be "promoting" it.
    >>
    >> IIRC Windows comes with Segoe UI Emoji preinstalled too.

    Eli> Both are true, but AFAIK our policy until now was not to mention such
    Eli> fonts in fontset.el.

    Eli> Emoji is just one example, btw.  At least for MS-Windows, the latest
    Eli> versions come with many good fonts that cover most of the scripts.  So
    Eli> if the restriction to avoid mentioning proprietary fonts in fontset.el
    Eli> could be lifted, we could produce a very capable and complete fontset
    Eli> for MS-Windows.  I wouldn't be surprised if the same situation didn't
    Eli> exist on macOS.  Not sure how things are on GNU/Linux, and what are
    Eli> the differences between the distros in this respect.

Another thing that could be useful on GNU/Linux is to take advantage
of the fact that most of them go out of their way to define
pseudo-families for particular uses, such as 'emoji' or 'math', which
then automatically adjust to the fonts installed on the system:

$ fc-match 'emoji'
NotoColorEmoji.ttf: "Noto Color Emoji" "Regular"
:~

If I were to uninstall Noto Color Emoji, the same command would now
return "Emoji One"

Robert
--



Reply | Threaded
Open this post in threaded view
|

bug#44020: 28.0.50; Prefer selection of colour emoji fonts?

Robert Pluim
In reply to this post by Stefan Kangas-2
>>>>> On Mon, 19 Oct 2020 19:03:22 +0000, Stefan Kangas <[hidden email]> said:

    Stefan> Robert Pluim <[hidden email]> writes:
    >> It *should* work as-is on GNU/Linux, but for some reason Emacs is
    >> completely refusing to use any Emoji fonts for me there. It始s possible
    >> I始ve messed up my system somehow, since emacs-27 has the same issue,
    >> but I始m seeing some very suspicious results from
    >> ftcrfont_glyph_extents (the font average width is always 0), so perhaps
    >> we need to adjust our font code.
    >>
    >> Testing appreciated.

    Stefan> I applied your patch running on Debian GNU/Linux (bullseye/testing), and
    Stefan> was able to display the "馃帀" character from Lars' original message just
    Stefan> fine here.

Thanks. I guess that means my local installation is screwed up
somehow [1]. Time to download a new one 馃槉

Robert

Footnotes:
[1]  It始s gone through a dist-upgrade at least 3 times, that始s bound
     to leave some scars.

--



Reply | Threaded
Open this post in threaded view
|

bug#44020: 28.0.50; Prefer selection of colour emoji fonts?

Eli Zaretskii
In reply to this post by Eli Zaretskii
> From: Stephen Berman <[hidden email]>
> Cc: Robert Pluim <[hidden email]>,  [hidden email],  [hidden email]
> Date: Mon, 19 Oct 2020 21:03:49 +0200
>
> > Didn't someone say they can see color emoji on Cairo?
>
> Yes, Lars noted (and I confirm) that the following two lines suffice:
>
> (set-fontset-font t 'symbol "Noto Color Emoji")
> (set-fontset-font t 'symbol "Symbola" nil 'append)

Are the Emoji displayed by Noto Color Emoji or by Symbola?

And what version of Noto Color Emoji do you have?

And finally, could you step through the code shown by Robert and tell
whether the Noto Color Emoji's average_width you get is also zero or
non-zero?

Thanks.



Reply | Threaded
Open this post in threaded view
|

bug#44020: 28.0.50; Prefer selection of colour emoji fonts?

Eli Zaretskii
In reply to this post by Stefan Kangas-2
> From: Stefan Kangas <[hidden email]>
> Date: Mon, 19 Oct 2020 19:03:22 +0000
> Cc: [hidden email], [hidden email]
>
> I applied your patch running on Debian GNU/Linux (bullseye/testing), and
> was able to display the "馃帀" character from Lars' original message just
> fine here.

Please see if you can answer the questions I asked Stephen.

Thanks.



Reply | Threaded
Open this post in threaded view
|

bug#44020: 28.0.50; Prefer selection of colour emoji fonts?

Stephen Berman
In reply to this post by Eli Zaretskii
On Mon, 19 Oct 2020 22:46:50 +0300 Eli Zaretskii <[hidden email]> wrote:

>> From: Stephen Berman <[hidden email]>
>> Cc: Robert Pluim <[hidden email]>,  [hidden email],  [hidden email]
>> Date: Mon, 19 Oct 2020 21:03:49 +0200
>>
>> > Didn't someone say they can see color emoji on Cairo?
>>
>> Yes, Lars noted (and I confirm) that the following two lines suffice:
>>
>> (set-fontset-font t 'symbol "Noto Color Emoji")
>> (set-fontset-font t 'symbol "Symbola" nil 'append)
>
> Are the Emoji displayed by Noto Color Emoji or by Symbola?

The majority of characters in emoji-data.txt are displayed by Noto Color
Emoji, but a number of them are displayed by Symbola and some are
displayed as tofu.

> And what version of Noto Color Emoji do you have?

v2018-04-24-pistol-update

> And finally, could you step through the code shown by Robert and tell
> whether the Noto Color Emoji's average_width you get is also zero or
> non-zero?

I started emacs -Q in gdb, evaluated the above two set-fontset-font
sexps, put a breakpoint on font_open_entity, and typed `M-x 8 RET
GRINNING FACE RET' and gdb took control, then I stepped through the
function until gdb output `if (font->average_width > 0 && font->height >
0)' and then I entered `p font->average_width' and gdb output $1 = 16.
Did I do this right and does that answer your question?  If not, please
advise.

Steve Berman



Reply | Threaded
Open this post in threaded view
|

bug#44020: 28.0.50; Prefer selection of colour emoji fonts?

Robert Pluim
>>>>> On Tue, 20 Oct 2020 05:35:39 +0300, Eli Zaretskii <[hidden email]> said:

    >> From: Stephen Berman <[hidden email]>
    >> Cc: [hidden email],  [hidden email],  [hidden email]
    >> Date: Tue, 20 Oct 2020 00:00:35 +0200
    >>
    >> > And what version of Noto Color Emoji do you have?
    >>
    >> v2018-04-24-pistol-update
    >>
    >> > And finally, could you step through the code shown by Robert and tell
    >> > whether the Noto Color Emoji's average_width you get is also zero or
    >> > non-zero?
    >>
    >> I started emacs -Q in gdb, evaluated the above two set-fontset-font
    >> sexps, put a breakpoint on font_open_entity, and typed `M-x 8 RET
    >> GRINNING FACE RET' and gdb took control, then I stepped through the
    >> function until gdb output `if (font->average_width > 0 && font->height >
    >> 0)' and then I entered `p font->average_width' and gdb output $1 = 16.
    >> Did I do this right and does that answer your question?  If not, please
    >> advise.

    Eli> Yes, that's it.  I wonder why Robert gets zero, perhaps a different
    Eli> version of the font?

it seems I始m not alone in having problems with Noto Color Emoji on
Ubuntu: <https://github.com/googlefonts/noto-emoji/issues/36>

Debian time, I think (which has been on my list for a while in any
case).

Robert
--



Reply | Threaded
Open this post in threaded view
|

bug#44020: 28.0.50; Prefer selection of colour emoji fonts?

Robert Pluim
>>>>> On Tue, 20 Oct 2020 09:33:49 +0200, Robert Pluim <[hidden email]> said:

>>>>> On Tue, 20 Oct 2020 05:35:39 +0300, Eli Zaretskii <[hidden email]> said:

    Eli> Yes, that's it.  I wonder why Robert gets zero, perhaps a different
    Eli> version of the font?

    Robert> it seems I始m not alone in having problems with Noto Color Emoji on
    Robert> Ubuntu: <https://github.com/googlefonts/noto-emoji/issues/36>

    Robert> Debian time, I think (which has been on my list for a while in any
    Robert> case).

So it was failing on Debian as well, until I deleted my
~/.config/fontconfig directory, which ended up fixing it on Ubuntu as
well.

Robert
--



Reply | Threaded
Open this post in threaded view
|

bug#44020: 28.0.50; Prefer selection of colour emoji fonts?

Eli Zaretskii
> From: Robert Pluim <[hidden email]>
> Cc: [hidden email],  [hidden email],  Stephen Berman
>  <[hidden email]>
> Date: Tue, 20 Oct 2020 10:58:31 +0200
>
> So it was failing on Debian as well, until I deleted my
> ~/.config/fontconfig directory, which ended up fixing it on Ubuntu as
> well.

This Fontconfig cache thingy appears in too many trouble reports.
Sounds like something we should ask users to do up front whenever they
report some weird font-related issue.



Reply | Threaded
Open this post in threaded view
|

bug#44020: 28.0.50; Prefer selection of colour emoji fonts?

Robert Pluim
>>>>> On Tue, 20 Oct 2020 17:28:14 +0300, Eli Zaretskii <[hidden email]> said:

    >> From: Robert Pluim <[hidden email]>
    >> Cc: [hidden email],  [hidden email],  Stephen Berman
    >> <[hidden email]>
    >> Date: Tue, 20 Oct 2020 10:58:31 +0200
    >>
    >> So it was failing on Debian as well, until I deleted my
    >> ~/.config/fontconfig directory, which ended up fixing it on Ubuntu as
    >> well.

    Eli> This Fontconfig cache thingy appears in too many trouble reports.
    Eli> Sounds like something we should ask users to do up front whenever they
    Eli> report some weird font-related issue.

To be clear: this is not the fontconfig cache, it始s the user-specific
directory for configuring fontconfig. I had one because I was playing
around with hinting styles at one point, and that始s exactly what can
cause Noto Color Emoji to fail (don始t ask me why).

But yes, we should ask people to move both the fontconfig cache and
the fontconfig user directory out of the way (or ask them to run
FC_DEBUG=1024 emacs -Q, which will show us which fontconfig config
files are being loaded).

Robert
--



12