From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Will Chang Newsgroups: gmane.emacs.bugs Subject: bug#54441: 28.0.92; set-language-environment causes Apple Color Emoji cannot show up Date: Sat, 19 Mar 2022 17:24:17 +0800 Message-ID: References: <83a6dnhhxt.fsf@gnu.org> <83mthmfn6w.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000008161f205da8ed46f" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11769"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mituharu+bug-gnu-emacs-mac@math.s.chiba-u.ac.jp, 54441@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 19 10:25:16 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 1nVVKl-0002pZ-GR for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Mar 2022 10:25:15 +0100 Original-Received: from localhost ([::1]:43036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVVKj-0008Pd-SW for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Mar 2022 05:25:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVVKY-0008Na-C7 for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2022 05:25:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36866) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nVVKY-00065n-30 for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2022 05:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nVVKY-0001hu-0b for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2022 05:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Will Chang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Mar 2022 09:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54441 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 54441-submit@debbugs.gnu.org id=B54441.16476818806527 (code B ref 54441); Sat, 19 Mar 2022 09:25:01 +0000 Original-Received: (at 54441) by debbugs.gnu.org; 19 Mar 2022 09:24:40 +0000 Original-Received: from localhost ([127.0.0.1]:58995 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVVKB-0001hB-Lp for submit@debbugs.gnu.org; Sat, 19 Mar 2022 05:24:40 -0400 Original-Received: from mail-ej1-f44.google.com ([209.85.218.44]:40712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVVK7-0001ge-6Z for 54441@debbugs.gnu.org; Sat, 19 Mar 2022 05:24:35 -0400 Original-Received: by mail-ej1-f44.google.com with SMTP id p15so21108151ejc.7 for <54441@debbugs.gnu.org>; Sat, 19 Mar 2022 02:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ftrrw03yN/YM+aJeUq8BJqPrVCB1WKzudhay1PpjfX4=; b=bs0GmQ3uo1bq3y0ZL7RJh7lIyE7eet1t7h6RAwkRsNk3QFsN9XW3c5nInTNDzxDCXa kP58Bu9s/aXlEPGtfn59gHpkq+BHpLpFGHoNsZdJwlCOhuUF1EJQOKxMasVr22b7ZNca EUXZrsh9CK6QGFaf9J9nCR4fb0dFrxPrZ4r3jdXDvRMUd4kH6fDduF9RYmTOP7NFPvYu NDzC1J/hbORmWX1hLm/vMpAgprD2vCi9m9TxAaJYurMkHMV2Yp1Fk3DhPD1JEITxHb7j YGhSFpgZs8R49EIlTHNToU62UoOBFHJaGNvAoYDzgHs8IIyrrFuhKeSBvn8mEejTbXCv wVMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ftrrw03yN/YM+aJeUq8BJqPrVCB1WKzudhay1PpjfX4=; b=FoENmn8BV6XwF+0MLVpwpt7jIJ9z9HaFKFGRd6Qb/2ticrwCFN1yvmlzL2pHgOrsdL OvGx5BBSh7MjNnmX9ojYZH5McTgCys9LG+3uaPGAw3nz2uufwNJ6+odbrvd1rHO1+nJJ FQOzlCyX8awjqpXtwPRUzsRB3K4rav8JVNxPPCoZBTPAV7pJKlIfPtQDKBEjXq1ADnuC FnoBB8dv70KTGNks3VkRH8EG1+I1Rf/lUVObidJP/VepoUFqJVJb1NKINj7aqbgto8SZ E6UDsI02SWrwgkKhxtRzepu4PaqC6IjJ8vYhuFPlxKjM81DzOs6xGwQ4rywKqwi1VFad Y5pA== X-Gm-Message-State: AOAM5319jaGydmlbtm2wACnRl9B9UQi7CXvGY1EM5SvbpMCFhmkJ89IV rVAl4/ZdAcI2JyqePL32ELveYe7gGDm4o+th0GI= X-Google-Smtp-Source: ABdhPJyILfeZ22CS+8ukKwWdycjC9VJ3aBQT2+1G6n5UqTw7+CHeKu1NfpnEKzfM7BI2BbT8LDwdQ7+ndgDPJqO2CI4= X-Received: by 2002:a17:906:3e90:b0:6b6:829b:577c with SMTP id a16-20020a1709063e9000b006b6829b577cmr12560463ejj.711.1647681869011; Sat, 19 Mar 2022 02:24:29 -0700 (PDT) In-Reply-To: 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:228584 Archived-At: --0000000000008161f205da8ed46f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Eli, I searched this problem again and found: https://www.reddit.com/r/emacs/comments/pmghug/how_to_correctly_display_mul= ticharacter_emojis/ https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg01238.html The code below can solve the problem. (set-fontset-font t 'emoji '("Apple Color Emoji" . "iso10646-1") nil 'prepend) or (set-fontset-font t '(#x1f000 . #x1faff) (font-spec :family "Apple Color Emoji")) You are absolutely right on this: > 1) It is a very bad idea to do the likes of > > (set-fontset-font "fontset-default" 'unicode "Apple Color Emoji" nil 'prepend) > > That's because the character set 'unicode spans the entire range > of Unicode characters, and there's no single font that can > possibly support all of those characters. On Sat, Mar 19, 2022 at 4:51 PM Will Chang wrote: > > So it's a "C" (a.k.a. "Posix") language environment, looks like. > > Somewhat strange, but maybe this is "usual" on macOS? > > On the previous Emacs Mac Port versions, Emacs doesn't need to set > the code below to enable Emoji and the UTF-8 environment doesn't affect i= t. > > (set-fontset-font "fontset-default" 'unicode "Apple Color Emoji" nil > 'prepend) > > Maybe it's a bug on that port, I CC'ed the maintainer Mituharu. > > > > What happens if you evaluate > > > > (set-fontset-font "fontset-default" 'unicode "Apple Color Emoji" nil > 'prepend) > > > > again, after changing the language environment? > > It remains the same. > > > AFAICT, this shows that "incorrect" means Emacs uses the Symbola font. > > Thanks for the info. > > > Does Apple Color Emoji on your system have glyphs for the #x1F300 and > > #x1F600 characters? Those are the characters we request to be > > supported by a font that is used for emoji. > > I believe it has. > > > Currently, I removed the UTF-8 code and set the Apple Color Emoji font fo= r > a > temporary solution. > > Again, thanks for your help, I learned a lot with your conversation, > you're so kind. ;) > > On Sat, Mar 19, 2022 at 2:53 PM Eli Zaretskii wrote: > >> [Please use Reply All so that the bug tracker is CC'ed.] >> >> > From: Will Chang >> > Date: Sat, 19 Mar 2022 11:06:06 +0800 >> > >> > >does this happen in "emacs -Q", if you evaluate the above >> > immediately upon entering Emacs? >> > >> > Yes. Tested it on: >> > "GNU Emacs 28.0.92 (build 2, x86_64-apple-darwin21.4.0, Carbon Version >> 165 >> > AppKit 2113.4) >> > of 2022-03-18" >> > "GNU Emacs 28.0.92 (build 1, x86_64-apple-darwin18.7.0, NS >> appkit-1671.60 >> > Version 10.14.6 (Build 18G95)) >> > of 2022-03-14" >> > >> > > what is the language environment before the evaluation of >> > set-language-environment above? >> > >> > I run describe-language-environment and got: >> > >> > English language environment >> > >> > Nothing special is needed to handle English. >> > >> > Sample text: >> > Hello!, Hi!, How are you? >> > >> > Input methods: >> > programmer-dvorak ("DVP@" in mode line) >> > english-dvorak ("DV@" in mode line) >> > >> > Character sets: >> > ascii: ASCII (ISO646 IRV) >> > >> > Coding systems: >> > nothing specific to English >> >> So it's a "C" (a.k.a. "Posix") language environment, looks like. >> Somewhat strange, but maybe this is "usual" on macOS? >> >> > > what is the output of "M-x describe-fontset RET fontset-default RET" >> > after evaluating set-language-environment, in particular in the >> > Emoji block starting from #x1F600? >> > >> > =F0=9F=98=80 .. =F0=9F=99=8F (#x1F600 .. #x1F64F) >> > -*-Apple Color Emoji-*-*-*-*-*-*-*-*-*-*-*-* >> > -*-Noto Color Emoji-*-*-*-*-*-*-*-*-*-*-iso10646-1 >> > -*-Symbola-*-*-*-*-*-*-*-*-*-*-iso10646-1 >> > [-*-Symbola-normal-normal-semicondensed-*-12-*-*-*-p-0-iso10646-1] >> >> It sounds like Emacs used Symbola, although Apple Color Emoji is in >> the list, and is first in the list. Which probably means Emacs >> examined Apple Color Emoji and rejected it for some reason. >> >> What happens if you evaluate >> >> (set-fontset-font "fontset-default" 'unicode "Apple Color Emoji" nil >> 'prepend) >> >> again, after changing the language environment? >> >> > >what did you mean by "emoji doesn't show up correctly"? how was it >> > displayed "incorrectly"? >> > >> > The screenshots: >> > - default: https://i.imgur.com/jLcwEDk.png >> > - English with fontset(correctly): https://i.imgur.com/qgqhCHF.png >> > - UTF-8 with fontset: https://i.imgur.com/tkjOVGv.png >> >> AFAICT, this shows that "incorrect" means Emacs uses the Symbola font. >> >> Does Apple Color Emoji on your system have glyphs for the #x1F300 and >> #x1F600 characters? Those are the characters we request to be >> supported by a font that is used for emoji. >> > --0000000000008161f205da8ed46f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Eli,

I searched this prob= lem again and found:

The code below c= an solve=C2=A0the problem.

=C2=A0 (set-fontset-font t &= #39;emoji '("Apple Color Emoji" . "iso10646-1") nil= 'prepend)

or

=C2=A0 (set-fontset-font= t '(#x1f000 . #x1faff) (font-spec :family "Apple Color Emoji"= ;))


You are absolutely right on= this:

> 1) It is a very bad idea t= o do the likes of
>
= >=C2=A0 =C2=A0 (set-fontset-font "fontset-default" 'unicod= e "Apple Color Emoji" nil 'prepend)
>
>=C2=A0 =C2=A0 That's because the charact= er set 'unicode spans the entire range
>= =C2=A0 =C2=A0 of Unicode characters, and there's no single font that ca= n
>=C2=A0 =C2=A0 possibly support all of those= characters.


On Sat, Mar 19, 2022 at 4:= 51 PM Will Chang <will.b.chang@gmail.com> wrote:
> So it's a "C&quo= t; (a.k.a. "Posix") language environment, looks like.
> Somewhat strange, but maybe this is "usual" o= n macOS?

On the previous Emacs Mac Port versions, Em= acs doesn't need to set
the code below to enable Emoji and th= e UTF-8 environment doesn't affect=C2=A0it.

=C2=A0 (set-fontset-font "fontset-def= ault" 'unicode "Apple Color Emoji" nil 'prepend)

= Maybe it's a bug on that port, I CC'ed=C2=A0the maintainer Mituharu= .


> What happens if you evaluate=
= >
>=C2=A0 =C2=A0(set-fontset-font "fon= tset-default" 'unicode "Apple Color Emoji" nil 'prep= end)
>
> a= gain, after changing the language environment?

<= div>It remains the same.

> AFAICT, this shows t= hat "incorrect" means Emacs uses the Symbola font.
=
Thanks for the info.

> Does Apple Color Emoji on your system have glyphs for the #x1F300 an= d
> #x1F600 characters?=C2=A0 Those are the ch= aracters we request to be
> supported by a fon= t that is used for emoji.

I believe it has.


Currently, I removed the UTF-8 code a= nd set the Apple Color Emoji font for a
temporary solution.
=

Again, thanks for your help, I learned a lot with=C2=A0= your conversation, you're so kind. ;)

On Sat, Mar 19, 2022 at 2:53= PM Eli Zaretskii <eli= z@gnu.org> wrote:
[Please use Reply All so that the bug tracker is CC'ed.]

> From: Will Chang <will.b.chang@gmail.com>
> Date: Sat, 19 Mar 2022 11:06:06 +0800
>
> >does this happen in "emacs -Q", if you evaluate the abov= e
> immediately upon entering Emacs?
>
> Yes. Tested it on:
> "GNU Emacs 28.0.92 (build 2, x86_64-apple-darwin21.4.0, Carbon Ve= rsion 165
> AppKit 2113.4)
>=C2=A0 of 2022-03-18"
> "GNU Emacs 28.0.92 (build 1, x86_64-apple-darwin18.7.0, NS appkit= -1671.60
> Version 10.14.6 (Build 18G95))
>=C2=A0 of 2022-03-14"
>
> > what is the language environment before the evaluation of
>=C2=A0 =C2=A0 =C2=A0set-language-environment above?
>
> I run describe-language-environment and got:
>
> English language environment
>
> Nothing special is needed to handle English.
>
> Sample text:
>=C2=A0 =C2=A0Hello!, Hi!, How are you?
>
> Input methods:
>=C2=A0 =C2=A0programmer-dvorak ("DVP@" in mode line)
>=C2=A0 =C2=A0english-dvorak ("DV@" in mode line)
>
> Character sets:
>=C2=A0 =C2=A0ascii: ASCII (ISO646 IRV)
>
> Coding systems:
>=C2=A0 =C2=A0nothing specific to English

So it's a "C" (a.k.a. "Posix") language environment= , looks like.
Somewhat strange, but maybe this is "usual" on macOS?

> > what is the output of "M-x describe-fontset RET fontset-defa= ult RET"
>=C2=A0 =C2=A0 =C2=A0after evaluating set-language-environment, in parti= cular in the
>=C2=A0 =C2=A0 =C2=A0Emoji block starting from #x1F600?
>
> =F0=9F=98=80 .. =F0=9F=99=8F (#x1F600 .. #x1F64F)
>=C2=A0 =C2=A0 =C2=A0-*-Apple Color Emoji-*-*-*-*-*-*-*-*-*-*-*-*
>=C2=A0 =C2=A0 =C2=A0-*-Noto Color Emoji-*-*-*-*-*-*-*-*-*-*-iso10646-1<= br> >=C2=A0 =C2=A0 =C2=A0-*-Symbola-*-*-*-*-*-*-*-*-*-*-iso10646-1
> [-*-Symbola-normal-normal-semicondensed-*-12-*-*-*-p-0-iso10646-1]

It sounds like Emacs used Symbola, although Apple Color Emoji is in
the list, and is first in the list.=C2=A0 Which probably means Emacs
examined Apple Color Emoji and rejected it for some reason.

What happens if you evaluate

=C2=A0 (set-fontset-font "fontset-default" 'unicode "App= le Color Emoji" nil 'prepend)

again, after changing the language environment?

> >what did you mean by "emoji doesn't show up correctly&quo= t;? how was it
>=C2=A0 =C2=A0 =C2=A0displayed "incorrectly"?
>
> The screenshots:
> - default: https://i.imgur.com/jLcwEDk.png
> - English with fontset(correctly): https://i.imgur.com/qgqhCHF.p= ng
> - UTF-8 with fontset: https://i.imgur.com/tkjOVGv.png

AFAICT, this shows that "incorrect" means Emacs uses the Symbola = font.

Does Apple Color Emoji on your system have glyphs for the #x1F300 and
#x1F600 characters?=C2=A0 Those are the characters we request to be
supported by a font that is used for emoji.
--0000000000008161f205da8ed46f--