From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Benjamin Riefenstahl Newsgroups: gmane.emacs.devel Subject: Re: scratch/emoji vs emacs that maybe =?utf-8?Q?can=CA=BCt?= display emojis Date: Sun, 07 Nov 2021 17:34:53 +0100 Message-ID: <878rxzexg2.fsf@turtle-trading.net> References: <87y263ko4i.fsf@gmail.com> <87cznek745.fsf@gnus.org> <87bl2yk6qz.fsf@gmail.com> <87wnlkeysw.fsf@gnus.org> <87sfw8eyi0.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17453"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 07 17:35:39 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mjl8s-0004N7-Pn for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Nov 2021 17:35:38 +0100 Original-Received: from localhost ([::1]:39776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjl8r-0000kX-Nz for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Nov 2021 11:35:37 -0500 Original-Received: from [2001:470:142:3::10] (port=42432 helo=eggs.gnu.org) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjl8G-0008Ou-Qw for emacs-devel@gnu.org; Sun, 07 Nov 2021 11:35:00 -0500 Original-Received: from odoacer.turtle-trading.net ([93.241.193.16]:41839) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1mjl8F-0006OP-6c for emacs-devel@gnu.org; Sun, 07 Nov 2021 11:35:00 -0500 Original-Received: from zenobia.turtle-trading.net ([192.168.2.111]) by odoacer.turtle-trading.net with esmtp (Exim 4.80) (envelope-from ) id 1mjl89-0002pE-N0; Sun, 07 Nov 2021 17:34:53 +0100 Original-Received: from benny by zenobia.turtle-trading.net with local (Exim 4.94.2) (envelope-from ) id 1mjl89-000Ace-F1; Sun, 07 Nov 2021 17:34:53 +0100 In-Reply-To: <87sfw8eyi0.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 07 Nov 2021 17:12:07 +0100") Received-SPF: none client-ip=93.241.193.16; envelope-from=benny@turtle-trading.net; helo=odoacer.turtle-trading.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:278967 Archived-At: I note that the display in my Gnome-Terminal follows the output of string-width as you show it. So this terminal emulator and Emacs at least are in agreement ;-). Lars Ingebrigtsen writes: > Not for all of them. Normal single-char glyphs are correct: > > (string-width "=F0=9F=98=80") > =3D> 2 This is shown correctly, the emoji occupies two columns. > But grapheme clusters are wrong: > > (string-width "=E2=98=BA=EF=B8=8F") > =3D> 1 Here the display of the emoji also occupies two columns, IOW the glyph is correctly display by the font. But the closing quote overlaps the emoji, probably because the terminal thinks it is just one column wide. > Presumably because it doesn't know that it's a cluster? Because it > computes the width of just the first code point without the variation > selector: > > (string-width "=E2=98=BA") > =3D> 1 Here the emoji has only one column, and this is shown correctly. Another note: In my own work with this issue, using NCurses, I have noticed that NCurses mostly relies on the C library's wcwidth function. Which seems reasonable for NCurses. I am not saying that Emacs should do the same, but I expect NCurses and terminal emulators to develop in a certain dependency, because it seem that NCurses is the most-used full-screen terminal library these days.