Commit 754ea228e1fa
Changed files (1)
dots
config
emacs
dots/config/emacs/init.el
@@ -135,29 +135,38 @@ Otherwise, call `backward-kill-word'."
(when (and (fboundp 'set-fontset-font) (member "Noto Sans Ethiopic" (font-family-list)))
(set-fontset-font t 'ethiopic "Noto Sans Ethiopic"))
- ;; If font-family-mono or font-family-sans are not available, use the default Emacs face
- (set-face-attribute 'default nil
- :family font-family-mono
- :height font-height
- :weight 'regular)
- (set-face-attribute 'fixed-pitch nil
- :family font-family-mono
- :weight 'medium
- :height font-height)
- (set-face-attribute 'variable-pitch nil
- :family font-family-sans
- :weight 'regular)
;; Use Monaspace Radon (handwriting) for italic faces — matches Kitty config
(defconst font-family-mono-italic
(font-spec :family "Monaspace Radon" :features '(calt liga ss01 ss02 ss03 ss04 ss05 ss06 ss07 ss08))
"Italic monospace font-family (Monaspace Radon handwriting variant).")
- (set-face-attribute 'italic nil
- :font font-family-mono-italic
- :slant 'italic)
- (set-face-attribute 'bold-italic nil
- :font font-family-mono-italic
- :weight 'bold
- :slant 'italic)
+
+ ;; Font setup must run when a GUI frame exists (daemon starts with no frame)
+ (defun vd/setup-fonts (&optional frame)
+ "Configure fonts for graphical frames."
+ (when-let* ((f (or frame (selected-frame))))
+ (when (display-graphic-p f)
+ (set-face-attribute 'default f
+ :font font-family-mono
+ :height font-height
+ :weight 'regular)
+ (set-face-attribute 'fixed-pitch f
+ :font font-family-mono
+ :weight 'medium
+ :height font-height)
+ (set-face-attribute 'variable-pitch f
+ :family font-family-sans
+ :weight 'regular)
+ (set-face-attribute 'italic f
+ :font font-family-mono-italic
+ :slant 'italic)
+ (set-face-attribute 'bold-italic f
+ :font font-family-mono-italic
+ :weight 'bold
+ :slant 'italic))))
+ ;; Apply to future frames (daemon mode)
+ (add-hook 'server-after-make-frame-hook #'vd/setup-fonts)
+ ;; Apply now if already in a GUI frame (non-daemon)
+ (vd/setup-fonts)
(when (fboundp 'set-fontset-font)
(set-fontset-font t 'symbol "Apple Color Emoji")