chenyanming / calibredb.el

Emacs calibre client - An Ebook Management Solution in Emacs.
GNU General Public License v3.0
323 stars 17 forks source link

book format not aligned when book title has Chinese characters #41

Open newusername2022 opened 3 years ago

newusername2022 commented 3 years ago
image

I found that book formats are not aligned when book titles have Chinese characters in them. This doesn't happen to English book titles.

chenyanming commented 3 years ago

Currently the font alignment is not handled by calibredb.el.

You should set up and use fixed width font, such as Sarasa Term SC for chinese.

(defun calibredb-font-setup ()
  (setq buffer-face-mode-face '(:family "Sarasa Term SC" :height 135))
  (buffer-face-mode))
(add-hook 'calibredb-search-mode-hook 'calibredb-font-setup)

Please notice, not all height values have the same fixed width, 135/150 are tested ok.

There are still other things that may not be aligned, such as icons, unicode and emoji.