bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#56691: outline-minor-mode displays navigation arrow buttons as emoji


From: Robert Pluim
Subject: bug#56691: outline-minor-mode displays navigation arrow buttons as emojis
Date: Fri, 29 Jul 2022 14:48:01 +0200

>>>>> On Fri, 29 Jul 2022 15:24:19 +0300, Eli Zaretskii <eliz@gnu.org> said:

    >> From: Lars Ingebrigtsen <larsi@gnus.org>
    >> Cc: hello@paulwrankin.com,  56691@debbugs.gnu.org
    >> Date: Fri, 29 Jul 2022 13:32:57 +0200
    >> 
    >> Eli Zaretskii <eliz@gnu.org> writes:
    >> 
    >> > The test for Emoji display is not accurate enough.  Maybe we should
    >> > have a display-color-emoji-p predicate?  I added a FIXME there.
    >> 
    >> Sounds like a good idea.  What would that predicate look like?

    Eli> I think we can currently only do that by looking at the details of the
    Eli> build.  Currently, color Emoji are supported only by builds with Cairo
    Eli> and HarfBuzz on Unix and by macOS builds.

    Eli> But even that could be not enough, since the necessary font may not be
    Eli> installed.  So here's another idea: use font-at to check that it
    Eli> returns one of the known color Emoji fonts for an Emoji character.
    Eli> For example:

    Eli>   (font-get (font-at 0 nil "😄") :family)
    Eli>    => Symbola

There are dozens if not hundreds of fonts capable of displaying colour
emoji. You really want to list them all? Is it such a bad thing if we
donʼt use the emoji when we could?

    Eli> We can then compare the value with a list of known families of fonts
    Eli> that support color Emoji.  The downside of this is that it can look
    Eli> for and load a font, which could be slow, especially if font-at
    Eli> returns nil, meaning there's no font for the character.

    Eli> So bottom line, something like this:

    Eli>   (defun display-color-emoji-p (&optional frame)
    Eli>     "DOC"
    Eli>     (and (display-multi-font-p frame)
    Eli>         (let ((font-obj (font-at 0 (frame-selected-window frame) "😄")))
    Eli>           (and (fontp font-at)
    Eli>                (member (font-get font-obj :family)
    Eli>                        list-of-known-emoji-font-families)))))

That will return nil here, but in this particular terminal emulator,
colour emoji display fine. Iʼve not been following, but I assume
thereʼs a "damn the torpedoes, I know what Iʼm doing" option for this
stuff.

Robert
-- 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]