unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Will Chang <will.b.chang@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: mituharu+bug-gnu-emacs-mac@math.s.chiba-u.ac.jp, 54441@debbugs.gnu.org
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	[thread overview]
Message-ID: <CAGe6RqQg3mda8-0s38tSYcKnk1jOBMsfuCVq9Vj1BT3yTNfxtw@mail.gmail.com> (raw)
In-Reply-To: <CAGe6RqSYY5tN4KE3gU2Lx_SFSKgjtmdEF1HDOrxfu+f65y1MJQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4913 bytes --]

Hi Eli,

I searched this problem again and found:
https://www.reddit.com/r/emacs/comments/pmghug/how_to_correctly_display_multicharacter_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 <will.b.chang@gmail.com> 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 it.
>
>   (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 for
> 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 <eliz@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 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?
>> >
>> > 😀 .. 🙏 (#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.
>>
>

[-- Attachment #2: Type: text/html, Size: 7674 bytes --]

  reply	other threads:[~2022-03-19  9:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18  3:41 bug#54441: 28.0.92; set-language-environment causes Apple Color Emoji cannot show up Will Chang
2022-03-18  6:51 ` Eli Zaretskii
     [not found]   ` <CAGe6RqR4U=ha8G967=+YEeS_bLUkSXRLAZKRrNGBY6kHkHxa-g@mail.gmail.com>
2022-03-19  6:53     ` Eli Zaretskii
2022-03-19  8:51       ` Will Chang
2022-03-19  9:24         ` Will Chang [this message]
2022-03-19  9:33           ` Eli Zaretskii
2022-03-19  9:36             ` Will Chang
2022-03-19 10:24               ` Eli Zaretskii

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=CAGe6RqQg3mda8-0s38tSYcKnk1jOBMsfuCVq9Vj1BT3yTNfxtw@mail.gmail.com \
    --to=will.b.chang@gmail.com \
    --cc=54441@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=mituharu+bug-gnu-emacs-mac@math.s.chiba-u.ac.jp \
    /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).