all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 39799@debbugs.gnu.org, Mike FABIAN <mfabian@redhat.com>
Subject: bug#39799: 28.0.50; Most emoji sequences don’t render correctly
Date: Fri, 28 Feb 2020 13:21:59 +0100	[thread overview]
Message-ID: <m28skm52c8.fsf@gmail.com> (raw)
In-Reply-To: <835zfrglu5.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 28 Feb 2020 10:25:22 +0200")

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

>>>>> On Fri, 28 Feb 2020 10:25:22 +0200, Eli Zaretskii <eliz@gnu.org> said:

    >> From: Mike FABIAN <mfabian@redhat.com>
    >> Cc: 39799@debbugs.gnu.org
    >> Date: Fri, 28 Feb 2020 08:36:10 +0100
    >> 
    >> > Patches are welcome to convert the emoji-related files in Unicode's
    >> > character database into appropriate composition-function-table setup,
    >> > similar to the example above.  Some script to be run at Emacs build
    >> > time and produce, say, lisp/emoji.el to populate
    >> > composition-function-table, would be nice (see the Awk scripts in
    >> > admin/unidata as one source of inspiration).
    >> 
    >> Pango also has a .c file which is generated by a python script from
    >> the Unicode emoji data files to make all these sequences known to Pango.
    >> 
    >> I can try to write a script. Would it be OK to use Python for such a
    >> script generating emoji.el?

    Eli> I'd prefer not to add Python as prerequisite for building Emacs.  We
    Eli> already use Awk, so using that'd be fine.

I suck at awk, but my attempt is attached. It DTRT for me under Cairo
if I change my fontset settings to use 'Noto Color Emoji' instead of
Symbola for:

             (#x1F300 . #x1F5FF)	;; Misc Symbols and Pictographs
             (#x1F900 . #x1F9FF)	;; Supplemental Symbols and Pictographs

It matches forward off the first char, so the
composition-function-table entries all have '0' as the number of chars
to match. Would it be better to match backwards? Weʼd run into the
4-character maximum for that, since some of the sequences are 7 or
more characters long.

    >> > If you mean they are not displayed in correct colors, then Emacs
    >> > doesn't yet support color emoji, we lack some infrastructure for
    >> > that.  Again, work in that area is welcome, it should be relatively
    >> > easy since we now have HarfBuzz support for text shaping.
    >> 
    >> Actually the color display works already. I tested with current master
    >> (build with cairo) and the emoji display just fine in color.

    Eli> Maybe in a Cairo build.  Or maybe I'm missing something.

Iʼm not seeing colour emoji in a -Q Cairo build. Which sequence is this
again?

Robert


[-- Attachment #2: emoji-zwj.awk --]
[-- Type: text/plain, Size: 2285 bytes --]

#!/usr/bin/awk -f

## Copyright (C) 2020 Free Software Foundation, Inc.

## Author: Robert Pluim <rpluim@gmail.com>

## This file is part of GNU Emacs.

## GNU Emacs is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.

## GNU Emacs is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.

## You should have received a copy of the GNU General Public License
## along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.

### Commentary:

## This script takes as input Unicode's emoji-zwj-sequences.txt
## (https://www.unicode.org/Public/emoji/12.0/emoji-zwj-sequences.txt)
## and produces output for Emacs's lisp/international/emoji-zwj.el.

## For additional details, see <https://debbugs.gnu.org/39799#8>.

## Things to do after installing a new version of emoji-zwj-sequences.txt:
## Check the output against the old output.

### Code:

/^[0-9A-F]/ {
    sub(/  *;.*/, "", $0)
    num = split($0, elts)
    if (ch[elts[1]] == "")
    {
        vec[elts[1]] = ""
        ch[elts[1]] = elts[1]
    }
    else
    {
        vec[elts[1]] = vec[elts[1]] " "
    }
        vec[elts[1]] = vec[elts[1]] "\""
    for (j = 1; j <= num; j++)
    {
        c = sprintf("\\N{U+%s}", elts[j])
        vec[elts[1]] = vec[elts[1]] c
    }
    vec[elts[1]] = vec[elts[1]] "\""
}

END {
    print ";;; emoji-zwj.el --- emoji zwj character composition table"
    print ";;; Automatically generated from admin/unidata/emoji-zwj-sequences.txt"
    print "(dolist (elt '("

    for (elt in ch)
    {
        printf("(#x%s . (%s))\n", elt, vec[elt])
}
    print "    ))"
    print "  (set-char-table-range composition-function-table"
    print "                        (car elt)"
    print "                        (list (vector (regexp-opt (cdr elt))"
    print "                                      0"
    print "                                      'compose-gstring-for-graphic))))"
    print "\n"
    print "(provide 'emoji-zwj)"
}

[-- Attachment #3: emoji-zwj.el --]
[-- Type: application/emacs-lisp, Size: 48758 bytes --]

  reply	other threads:[~2020-02-28 12:21 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 14:28 bug#39799: 28.0.50; Most emoji sequences don’t render correctly Mike FABIAN
2020-02-28  7:14 ` Eli Zaretskii
2020-02-28  7:36   ` Mike FABIAN
2020-02-28  8:25     ` Eli Zaretskii
2020-02-28 12:21       ` Robert Pluim [this message]
2020-02-28 12:46         ` Mike FABIAN
2020-02-28 13:19           ` Robert Pluim
2020-02-28 13:50             ` Mike FABIAN
2020-02-28 13:56               ` Eli Zaretskii
2020-02-28 14:44                 ` Mike FABIAN
2020-02-28 13:08         ` Eli Zaretskii
2020-02-28 13:47           ` Mike FABIAN
2020-02-28 13:54             ` Eli Zaretskii
2020-02-28 14:14           ` Robert Pluim
2020-02-28 14:45             ` Eli Zaretskii
2020-02-28 15:32               ` Mike FABIAN
2020-02-28 15:57                 ` Robert Pluim
2020-02-28 15:39               ` Robert Pluim
2020-02-28 16:38                 ` Mike FABIAN
2020-02-28 14:46             ` Eli Zaretskii
2020-02-28 15:35               ` Robert Pluim
2020-02-28 15:44                 ` Eli Zaretskii
2020-02-28 16:24                   ` Robert Pluim
2020-02-28 17:30                     ` Mike FABIAN
2020-02-28 17:55                       ` Mike FABIAN
2020-02-28 18:01                       ` Robert Pluim
2020-02-28 19:29                         ` Mike FABIAN
2020-02-28 19:34                         ` Mike FABIAN
2020-02-28 21:32                         ` Mike FABIAN
2020-02-28 21:38                           ` Robert Pluim
2020-02-28 20:21                       ` Eli Zaretskii
2020-02-28 20:25                         ` Eli Zaretskii
2020-02-28 21:02                           ` Eli Zaretskii
2020-02-28 21:47                             ` Robert Pluim
2020-02-28 22:07                               ` Eli Zaretskii
2020-02-29  7:50                                 ` Mike FABIAN
2020-02-29  9:40                                   ` Eli Zaretskii
2020-02-29 10:45                                     ` Mike FABIAN
2020-02-28 21:10                         ` Mike FABIAN
2020-02-28 21:49                           ` Eli Zaretskii
2020-02-29  7:59                             ` Mike FABIAN
2020-02-29 10:04                               ` Eli Zaretskii
2020-02-29 11:14                                 ` Mike FABIAN
2020-02-29 11:52                                   ` Eli Zaretskii
2020-02-29 16:59                                     ` Mike FABIAN
2020-02-28 20:13                     ` Eli Zaretskii
2020-02-28 20:38                       ` Robert Pluim
2020-02-28 20:55                         ` Eli Zaretskii
2020-02-28 21:22                           ` Robert Pluim
2020-02-28 21:27                             ` Mike FABIAN
2020-02-28 21:52                             ` Eli Zaretskii
2020-02-29  8:01                               ` Mike FABIAN
2020-02-29  9:49                                 ` Eli Zaretskii
2020-02-29 10:26                                   ` Mike FABIAN
2020-02-29 11:19                                     ` Eli Zaretskii
2020-02-29 11:36                                       ` Mike FABIAN
2020-02-29 11:58                                         ` Eli Zaretskii
2020-02-29 17:03                                           ` Mike FABIAN
2020-02-29 17:19                                             ` Eli Zaretskii
2020-02-29 11:41                                       ` Mike FABIAN
2020-02-29 12:02                                         ` Eli Zaretskii
2020-02-29 17:14                                           ` Mike FABIAN
2020-02-29 17:27                                             ` Eli Zaretskii
2020-03-02  9:10                                               ` Robert Pluim
2020-03-02 11:02                                                 ` Eli Zaretskii
2020-02-28 21:14                         ` Mike FABIAN
2020-02-28 21:50                           ` Eli Zaretskii
2020-02-28 16:19             ` Eli Zaretskii
2020-02-28 16:39               ` Robert Pluim
2020-02-28 20:16                 ` Eli Zaretskii
2020-02-28 20:56                   ` Robert Pluim
2021-09-20 20:38                     ` Robert Pluim
2021-09-21  9:16                       ` Eli Zaretskii
2021-09-21 10:34                         ` Robert Pluim
2021-09-21 10:54                           ` Eli Zaretskii
2021-09-21 11:31                             ` Eli Zaretskii
2021-09-21 17:43                               ` Robert Pluim
2021-09-21 18:28                                 ` Eli Zaretskii
2021-09-22  9:02                                   ` Robert Pluim
2021-09-24 19:28                                     ` Mike FABIAN
2021-09-25  5:55                                       ` Eli Zaretskii
2021-09-25  7:35                                         ` Mike FABIAN
2021-09-25  9:19                                           ` Eli Zaretskii
2021-11-06 18:59                                             ` Lars Ingebrigtsen
2021-09-21 11:48                       ` Mike FABIAN
2021-09-21 11:58                         ` Eli Zaretskii
2021-09-21 12:27                           ` Mike FABIAN
2021-09-21 12:37                             ` Eli Zaretskii
2021-09-21 12:50                           ` Robert Pluim
2021-09-21 13:06                             ` Eli Zaretskii
2021-09-21 13:25                               ` Mike FABIAN
2021-09-21 13:53                                 ` Robert Pluim
2021-09-21 14:19                                   ` Eli Zaretskii
2021-09-21 14:43                                     ` Robert Pluim
2021-09-21 15:58                                       ` Eli Zaretskii
2021-09-21 16:10                                         ` Robert Pluim
2021-09-21 16:23                                           ` Eli Zaretskii
2021-09-21 16:50                                             ` Eli Zaretskii
2021-09-21 18:20                                               ` Eli Zaretskii
2021-09-22  8:59                                                 ` Robert Pluim
2021-09-22 13:47                                                   ` Eli Zaretskii
2021-09-24 11:41                                                 ` Robert Pluim
2021-09-24 12:04                                                   ` Eli Zaretskii
2021-09-24 12:10                                                     ` Robert Pluim

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

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

  git send-email \
    --in-reply-to=m28skm52c8.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=39799@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=mfabian@redhat.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.