From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#56691: outline-minor-mode displays navigation arrow buttons as emojis Date: Fri, 29 Jul 2022 15:24:19 +0300 Message-ID: <83wnbw6r9o.fsf@gnu.org> References: <15cd39ee8fe919a8656095fbfa5ae85e@purelymail.com> <83k085lhj1.fsf@gnu.org> <87o7xg5ob9.fsf@gnus.org> <83tu78i9xz.fsf@gnu.org> <875yjo47a8.fsf@gnus.org> <83pmhwi8i7.fsf@gnu.org> <87k0842s4s.fsf@gnus.org> <83o7xgi53z.fsf@gnu.org> <87zggyyiy3.fsf@gnus.org> <874jz1wgzm.fsf@gnus.org> <83sfml8gez.fsf@gnu.org> <87czdom9w6.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6837"; mail-complaints-to="usenet@ciao.gmane.io" Cc: hello@paulwrankin.com, 56691@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 29 14:25:15 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oHP3K-0001an-Aa for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Jul 2022 14:25:14 +0200 Original-Received: from localhost ([::1]:60550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oHP3J-0005X2-7F for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Jul 2022 08:25:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHP38-0005VD-PS for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2022 08:25:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42136) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oHP38-0007L1-GO for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2022 08:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oHP38-0004Ef-CH for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2022 08:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Jul 2022 12:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56691 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 56691-submit@debbugs.gnu.org id=B56691.165909745716216 (code B ref 56691); Fri, 29 Jul 2022 12:25:02 +0000 Original-Received: (at 56691) by debbugs.gnu.org; 29 Jul 2022 12:24:17 +0000 Original-Received: from localhost ([127.0.0.1]:60118 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHP2O-0004DU-V2 for submit@debbugs.gnu.org; Fri, 29 Jul 2022 08:24:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHP2M-0004DH-Lb for 56691@debbugs.gnu.org; Fri, 29 Jul 2022 08:24:15 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:33852) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHP2H-0007Fp-72; Fri, 29 Jul 2022 08:24:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=oooAVFW6yKMPYVkJNvSZ3FJoaRblo3YXZofmi6JDljc=; b=rUwXPvU0ZaW/NkT1rfL+ CU3uE+XomzQ1WNQ5nD8TKcBbxpiQCL6+G8iUvN07rB4Oq+z74u13g7Y5V1QEg9mz3FPtX7ZPP5B5Z Zx4W9pEuG/dR5X7c20/ER2mtdRK0uC8UUnoHcCJwpoIuct+2EsY6IBdy4W3N62bs2PdqRERHdJmdd QPEwCJ5ZGViICPOiDrZZRvzlSeeTkFMdWdPI9E9X8CmwAPkzRxERiz8PaAFk9PrYdLdcv7TRxtbC9 S/LyovexZqzp3uNdR3KVNBGJtugVOK4XPwO1/KCEpkjzhEwMVAGX/PDbnHjXirtYu4r613/EP/XKx apK30zsBWM9+8Q==; Original-Received: from [87.69.77.57] (port=4400 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHP2G-0004Ex-NW; Fri, 29 Jul 2022 08:24:09 -0400 In-Reply-To: <87czdom9w6.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri, 29 Jul 2022 13:32:57 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:238158 Archived-At: > From: Lars Ingebrigtsen > Cc: hello@paulwrankin.com, 56691@debbugs.gnu.org > Date: Fri, 29 Jul 2022 13:32:57 +0200 > > Eli Zaretskii 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)))))