emacs-libvterm icon indicating copy to clipboard operation
emacs-libvterm copied to clipboard

Line spacing with non-latin fonts

Open heytings opened this issue 5 years ago • 3 comments

When non-latin fonts are used, the line spacing becomes (or can become) irregular: image This is not a real problem when using a shell, but becomes a problem when the first or last line(s) of a full screen terminal app such as Mutt or Vim become invisible.

heytings avatar Oct 24 '20 16:10 heytings

Can you give me specific steps to reproduce the problem with vim?

Sbozzolo avatar Oct 25 '20 23:10 Sbozzolo

Just open the HELLO file in Emacs' etc subdirectory, and move around. Assuming that you have the necessary non-latin fonts installed (I have Debian's fonts-noto-core package), when you open that file you will not see the status bar at the bottom. And if you have a title bar it will disappear at some point.

heytings avatar Oct 25 '20 23:10 heytings

This may have more to do with the selected font. For vterm to space correctly for me, I had to use a terminal friendly font for vterm buffers. Here I override my usual font with one that was built just for terminals and doesn't become unaligned.

;; Set default font
(let ((font-name "Hack Nerd Font Mono-9:normal:monospace"))
  (set-frame-font font-name nil t)
  (add-to-list 'default-frame-alist `(font . ,font-name))
  (set-face-attribute 'default t :font font-name))

;; Set font activated for vterm, as some programs will try to use characters
;; only available with terminal font sets.
(defface vterm-buffer-local-face
  '((t :font "Iosevka Nerd Font Mono-8"))
  "Vterm buffer-local face")

(defun my/vterm-font-hook ()
  (buffer-face-set 'vterm-buffer-local-face))

(add-hook 'vterm-mode-hook 'my/vterm-font-hook)

herbertjones avatar Jan 18 '21 14:01 herbertjones