bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24699: Some characters should have char-width of 2


From: Eli Zaretskii
Subject: bug#24699: Some characters should have char-width of 2
Date: Sat, 15 Oct 2016 18:05:44 +0300

> From: Georges Ko <gko@gko.net>
> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]