unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: hello@paulwrankin.com, 56691@debbugs.gnu.org
Subject: bug#56691: outline-minor-mode displays navigation arrow buttons as emojis
Date: Fri, 29 Jul 2022 15:24:19 +0300	[thread overview]
Message-ID: <83wnbw6r9o.fsf@gnu.org> (raw)
In-Reply-To: <87czdom9w6.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri,  29 Jul 2022 13:32:57 +0200)

> 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	other threads:[~2022-07-29 12:24 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-22  4:57 bug#56691: outline-minor-mode displays navigation arrow buttons as emojis Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found] ` <handler.56691.B.16584658415826.ack@debbugs.gnu.org>
2022-07-22  5:00   ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-22  5:04     ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-22  5:19       ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-22  6:24       ` Gregory Heytings
2022-07-23  6:32         ` Lars Ingebrigtsen
2022-07-22  7:42     ` Eli Zaretskii
2022-07-23  6:35       ` Lars Ingebrigtsen
2022-07-23  7:07         ` Eli Zaretskii
2022-07-23  7:28           ` Lars Ingebrigtsen
2022-07-23  7:38             ` Eli Zaretskii
2022-07-23  7:41               ` Lars Ingebrigtsen
2022-07-23  8:51                 ` Eli Zaretskii
2022-07-24  9:10                   ` Lars Ingebrigtsen
2022-07-28 12:37                     ` Lars Ingebrigtsen
2022-07-28 14:23                       ` Eli Zaretskii
2022-07-29 11:32                         ` Lars Ingebrigtsen
2022-07-29 12:24                           ` Eli Zaretskii [this message]
2022-07-29 12:48                             ` Robert Pluim
2022-07-29 13:35                               ` Eli Zaretskii
2022-07-29 13:38                                 ` Lars Ingebrigtsen
2022-07-29 13:45                                   ` Eli Zaretskii
2022-07-29 13:50                                     ` Lars Ingebrigtsen
2022-07-29 13:48                                   ` Robert Pluim
2022-07-29 13:51                                     ` Eli Zaretskii
2022-07-29 13:47                                 ` Robert Pluim
2022-07-30 11:33                             ` Lars Ingebrigtsen
2022-07-30 11:44                               ` Eli Zaretskii
2022-07-30 14:12                               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-30 14:17                                 ` Lars Ingebrigtsen
2022-07-31  0:51                                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-31 10:08                                     ` Robert Pluim
2022-07-31 11:45                                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-01 10:36                                         ` Lars Ingebrigtsen
2022-08-01 10:42                                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-01 10:50                                             ` Lars Ingebrigtsen
2022-08-01 11:40                                             ` Eli Zaretskii
2022-08-01 11:51                                               ` Lars Ingebrigtsen
2022-08-01 12:14                                                 ` Eli Zaretskii
2022-08-01 12:36                                                   ` Lars Ingebrigtsen
2022-08-01 13:12                                                     ` Eli Zaretskii
2022-08-02  9:54                                                       ` Lars Ingebrigtsen
2022-08-02 11:18                                                         ` Eli Zaretskii
2022-08-02 11:20                                                           ` Lars Ingebrigtsen
2022-08-02 11:35                                                             ` Eli Zaretskii
2022-08-02 11:57                                                               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-02 12:02                                                                 ` Eli Zaretskii
2022-08-02 13:33                                                                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-03 11:05                                                                     ` Lars Ingebrigtsen
2022-08-03 11:33                                                                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-01 12:16                                               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-01 13:02                                                 ` Eli Zaretskii
2022-08-01 13:20                                                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-01 13:34                                                     ` Eli Zaretskii
2022-08-01 13:47                                                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-01 13:53                                                         ` Eli Zaretskii
2022-08-01 14:04                                                           ` Robert Pluim
2022-08-10 11:39                                                             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-10 11:52                                                               ` Lars Ingebrigtsen
2022-08-10 12:08                                                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-12 14:56                                                                   ` Lars Ingebrigtsen
2022-08-13  1:49                                                                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-11  4:30                                                               ` Jim Porter
2022-08-11  7:56                                                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-12 14:57                                                                 ` Lars Ingebrigtsen
2022-08-13  1:54                                                                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-13 11:56                                                                     ` Lars Ingebrigtsen
2022-08-13 12:16                                                                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-13 12:24                                                                         ` Lars Ingebrigtsen
2022-08-13 12:39                                                                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-13  5:53                                                                   ` Jim Porter
2022-08-13  7:01                                                                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-13 11:58                                                                       ` Lars Ingebrigtsen
2022-08-13 12:17                                                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-13 12:25                                                                           ` Lars Ingebrigtsen
2022-08-13 12:34                                                                             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-13 12:37                                                                               ` Lars Ingebrigtsen
2022-08-13 12:42                                                                                 ` Lars Ingebrigtsen
2022-08-13 11:59                                                                     ` Lars Ingebrigtsen
2022-08-13 12:18                                                                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-01 11:38                                           ` Eli Zaretskii
2022-07-23  9:05             ` Visuwesh
2022-07-22  7:05 ` Eli Zaretskii
2022-07-22  7:49 ` Juri Linkov
2022-07-24  4:45 ` bug#56691: reopen Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-24  4:58   ` bug#56691: Better override Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83wnbw6r9o.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=56691@debbugs.gnu.org \
    --cc=hello@paulwrankin.com \
    --cc=larsi@gnus.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).