From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24699: Some characters should have char-width of 2 Date: Sat, 15 Oct 2016 18:05:44 +0300 Message-ID: <83lgxp1wl3.fsf@gnu.org> References: <834m4d3ix5.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1476544058 4517 195.159.176.226 (15 Oct 2016 15:07:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 15 Oct 2016 15:07:38 +0000 (UTC) Cc: 24699@debbugs.gnu.org To: Georges Ko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 15 17:07:33 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvQYO-00075T-1X for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Oct 2016 17:07:16 +0200 Original-Received: from localhost ([::1]:52273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvQYM-0007GG-SK for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Oct 2016 11:07:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvQYF-0007GA-IQ for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2016 11:07:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvQY9-0001Th-VO for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2016 11:07:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54054) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bvQY9-0001Ta-Rz for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2016 11:07:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bvQY9-0002M1-L2 for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2016 11:07:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Oct 2016 15:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24699 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24699-submit@debbugs.gnu.org id=B24699.14765439628976 (code B ref 24699); Sat, 15 Oct 2016 15:07:01 +0000 Original-Received: (at 24699) by debbugs.gnu.org; 15 Oct 2016 15:06:02 +0000 Original-Received: from localhost ([127.0.0.1]:60242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvQXB-0002Kh-TL for submit@debbugs.gnu.org; Sat, 15 Oct 2016 11:06:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39054) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvQX9-0002KD-Or for 24699@debbugs.gnu.org; Sat, 15 Oct 2016 11:06:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvQX0-00014p-KA for 24699@debbugs.gnu.org; Sat, 15 Oct 2016 11:05:54 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvQX0-00014J-GO; Sat, 15 Oct 2016 11:05:50 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4681 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bvQWy-0002jn-JV; Sat, 15 Oct 2016 11:05:49 -0400 In-reply-to: (message from Georges Ko on Sat, 15 Oct 2016 22:31:24 +0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:124519 Archived-At: > From: Georges Ko > Date: Sat, 15 Oct 2016 22:31:24 +0800 > > By consistency, I meant consistency with the characters of the same > "type", and by that I mean in the same code point block. Not all characters of a code block have the same width attribute. > Oh OK, that explains the widths, but some are of width 2 (see output at > the end of this post). I checked this EastAsianWidth.txt in > http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt: MAPLE > LEAF (#x1F341) and BEAR FACE (#x1F43B) are listed: > > 1F337..1F37C;W # So [70] TULIP..BABY BOTTLE > 1F400..1F43E;W # So [63] RAT..PAW PRINTS > > So BEAR FACE and MAPLE LEAF should be of the same width, but they are > not in Emacs: > > (char-width ?🍁) => 2 > (char-width ?🐻) => 1 Yes, the 1F400..1F43E range was missing. I now fixed that on the emacs-25 branch, so both of the above expressions return 2. > Could the EastAsianWidth.txt (not found in Emacs sources) used to > generate was an old version? It's more probable that this range was simply omitted. > Is the generated output in characters.el starting from this line? It's not aut-generated, it was written by hand. > > Can you tell what practical problem in Emacs are you trying to solve? > > A side effect of having non-consistent char-width is badly aligned > org-mode tables. A table with a MAPLE LEAF (width=2) and a BEAR FACE > (width=1) is aligned like this by org-mode: The width attribute will only help in alignment of text if the font used for these characters is monospaced, and then if the font designers indeed kept the width according to Unicode. Most fonts that support these characters are variable-pitch fonts, so you won't have any alignment anyway, unless org-table aligns columns on the pixel level, by using the pixel size of the text. > Block Miscellaneous Symbols and Pictographs: > > E = EastAsianWidth.txt (2=W, 1=N) and W = (char-width c) > > E | W | Char | Code Point | Name > --+---+-------+------------------+------------------------------- > 2 | 1 | 🐀 | #x1F400 (128000) | RAT > 2 | 1 | 🐁 | #x1F401 (128001) | MOUSE > 2 | 1 | 🐂 | #x1F402 (128002) | OX > 2 | 1 | 🐃 | #x1F403 (128003) | WATER BUFFALO > 2 | 1 | 🐄 | #x1F404 (128004) | COW > 2 | 1 | 🐅 | #x1F405 (128005) | TIGER > 2 | 1 | 🐆 | #x1F406 (128006) | LEOPARD > 2 | 1 | 🐇 | #x1F407 (128007) | RABBIT > 2 | 1 | 🐈 | #x1F408 (128008) | CAT > 2 | 1 | 🐉 | #x1F409 (128009) | DRAGON On my display, these columns are not aligned at all, even for characters whose char-width is 2. And I don't expect them to be aligned, because the font used is Symbola, which is not monospaced. OK to close this bug now? Thanks.