rougier / nano-theme

GNU Emacs / N Λ N O Theme
GNU General Public License v3.0
369 stars 35 forks source link

Font mess on emacs 30.0.50 #50

Closed albreche closed 11 months ago

albreche commented 11 months ago

Hi there, using the following config from my init file, my font setup fails, falling back on a garamont variable font (see picture bellow). Note everything but the fonts runs good.

(use-package nano-theme
  :straight
  (nano-theme :type git :host github :repo "rougier/nano-theme")
  :defer t
  :ensure t
  )
(require 'nano-theme)
(nano-mode)
(load-theme 'nano t)

config-nano

has anyone encounterd this problem ?

albreche commented 11 months ago

answering myself :) . I've not solved but done some progress: problem come from font selection in emacs and interaction with fontconfig or maybe xresource.
Btw, it may not be a nano-emacs related issue.
I let maintainer decide if it has to be close :)

albreche commented 11 months ago

ok, finally get throught it , for those who are interested i put the code below. As a matter of taste my config renders better regular/bold than light/regular, and code below also illustrate how to theme nano colors.

I keep thinking that font selection in emacs/linux is a mess, as i have to explicitly set fonts using fontspec/font name while it should be smooth using the default nano-theme code. Having it runs ok necessitate some complex fontconfig configuration, which is beside my skills.

(defvar default-fs (font-spec :name "RobotoMono Nerd Font Mono" :size 14.0 :weight 'regular ))
(defvar nano-mono-fs (font-spec :name "RobotoMono Nerd Font Mono" :size 14.0 :weight 'regular  ))
(defvar nano-mono-alt-fs  (font-spec :name "FiraCode Nerd Font" :size 14.0 :weight 'regular ))
(defvar nano-serif-fs (font-spec :name "Roboto Slab" :size 14.0 :weight 'regular ))
(defvar nano-sans-fs (font-spec :name "RobotoMono Nerd Font" :size 14.0 :weight 'regular ))
(defvar nano-italic-fs (font-spec :name "Victor Mono Italic" :size 14.0 :weight 'regular ))

(use-package nano-theme
  :straight (nano-theme :type git :host github :repo "rougier/nano-theme")
  :init
  (require 'nano-theme-support)
  (nano-mode)
  :custom
  (nano-light-background "#FFFFFF")
  (nano-light-critical "#FF0000")
  (nano-light-faded "#8267B0")
  (nano-light-foreground "#4B2882")
  (nano-light-highlight "#B4CAD8")
  (nano-light-popout "#047257")
  (nano-light-salient "#D7105F")
  (nano-light-strong "#160C26")
  (nano-light-subtle "#F2E7F5")
  :custom-face
  (nano-strong ((t (:weight bold))))
  (nano-strong-i ((t (:weight bold))))
  (nano-critical ((t (:weight bold))))
  (nano-critical-i ((t (:weight bold))))
  :config
  (load-theme 'nano t)
  (set-face-attribute 'default nil :font default-fs)
  (set-face-attribute 'nano-mono nil :font nano-mono-fs)
  (set-face-attribute 'nano-mono-alt nil :font nano-mono-alt-fs)
  (set-face-attribute 'nano-serif nil :font nano-serif-fs)
  (set-face-attribute 'nano-mono-alt nil :font nano-sans-fs)
  (set-face-attribute 'nano-italic nil :font nano-italic-fs)
  )

@rougier i close this issue.

rougier commented 10 months ago

Sorry, I was late reading my notifications and you solved the problem before I had a chance to look at it.

albreche commented 10 months ago

btw, i ended up with a solution - maybe over complaicated - which allow one to define some font set and color set, actually two font set and 4 color set ( two per theme). Once defined, one can switch between one or another through a function that under the hood call nano-theme. This gives you 8 possible combination, times two by setting a weight combination (light/medium, or medium/bold) . Was fun :)