djcb / mu

maildir indexer/searcher + emacs mail client + guile bindings
http://www.djcbsoftware.nl/code/mu
GNU General Public License v3.0
1.62k stars 391 forks source link

Subjects with Chinese characters are not aligned #921

Closed binshengliu closed 8 years ago

binshengliu commented 8 years ago

Expected or desired behavior

Subjects in header view are aligned.

Actual behavior

With Chinese characters, the subjects are not aligned.

image

Steps to reproduce

Send an email with Chinese characters in the "From" field.

Versions of mu, mu4e/emacs, operating system etc.

Built from 8d345ee.

\* mu4e - mu for emacs version 0.9.17 CG
$ mu --version
mu (mail indexer/searcher) version 0.9.17
GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5) of 2016-09-12, modified by Debian

Any other detail

Chinese font for "易":

             position: 8436 of 27023 (31%), column: 33
            character: 易 (displayed as 易) (codepoint 26131, #o63023, #x6613)
    preferred charset: unicode-bmp (Unicode Basic Multilingual Plane (U+0000..U+FFFF))
code point in charset: 0x6613
               script: han
               syntax: w    which means: word
             category: .:Base, C:2-byte han, L:Left-to-right (strong), c:Chinese, h:Korean, j:Japanese, |:line breakable
             to input: type "C-x 8 RET 6613"
          buffer code: #xE6 #x98 #x93
            file code: #xE6 #x98 #x93 (encoded by coding system utf-8-unix)
              display: by this font (glyph code)
    xft:-unknown-WenQuanYi Micro Hei-normal-normal-normal-*-13-*-*-*-*-0-iso10646-1 (#x1FC2)

Character code properties: customize what to show
  name: CJK IDEOGRAPH-6613
  general-category: Lo (Letter, Other)
  decomposition: (26131) ('易')

There is an overlay here:
 From 8397 to 8476
  face                 mu4e-header-highlight-face
  priority             -50
  window               nil

There are text properties here:
  docid                7533
  face                 mu4e-header-face
  msg                  [Show]

[back]

English font for "T":

             position: 8515 of 27023 (32%), column: 33
            character: T (displayed as T) (codepoint 84, #o124, #x54)
    preferred charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x54
               script: latin
               syntax: w    which means: word
             category: .:Base, L:Left-to-right (strong), a:ASCII, l:Latin, r:Roman
             to input: type "C-x 8 RET 54" or "C-x 8 RET LATIN CAPITAL LETTER T"
          buffer code: #x54
            file code: #x54 (encoded by coding system utf-8-unix)
              display: by this font (glyph code)
    xft:-unknown-DejaVu Sans Mono-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1 (#x37)

Character code properties: customize what to show
  name: LATIN CAPITAL LETTER T
  general-category: Lu (Letter, Uppercase)
  decomposition: (84) ('T')

There is an overlay here:
 From 8476 to 8611
  face                 mu4e-header-highlight-face
  priority             -50
  window               nil

There are text properties here:
  docid                7684
  face                 mu4e-unread-face
  msg                  [Show]

[back]
panjie commented 8 years ago

This is caused by your font, that is to say your Chinese font's width is not exactly double of your English font's.

binshengliu commented 8 years ago

Well, I find chinese-fonts-setup is a simple solution.

@panjie , thanks for your hint.