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: Eli Zaretskii
Subject: bug#56691: outline-minor-mode displays navigation arrow buttons as emojis
Date: Fri, 29 Jul 2022 15:24:19 +0300

> 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?

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

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

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

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

So bottom line, something like this:

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







reply via email to

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