Phil-Hudson · 2022-06-29 20:30
Why oh why has Emacs stopped using my preferred face (Iosevka) after updating from 27.2 to 28.1 (both self-built)? Is it something to do with xft and/or Cairo? If so, how do I fix it?
I found that I could get to something that was at least readable with:
(set-face-attribute 'default nil
:family "Hack"
:height 160
:weight 'normal
:width 'normal)
and customizing typeface `default` to use Hack, but even this seems to come and go, apparently each time I focus a different frame (WTF?!), leaving an unreadable mess of widely spaced characters.
Hack is a face I used to use, still installed. Kinda sorta good enough to be getting on with, so long as Emacs doesn't keep forgetting, but not what I want and specified.
Daemon mode, running on up-to-date Manjaro under StumpWM.
Edit: RESOLVED
The issue was the entry `Emacs.FontBackend` in my `~/.Xdefaults`. Commenting this line out brought everything back to normal font-wise. My thanks to those who reached out to help.
frozeninfate · 2022-06-29 21:30
Can you share your config? When using daemon mode, some font stuff needs to be done after the first frame is created
nv-elisp · 2022-06-29 21:40
Does the problem persist outside of Stumpwm?
Phil-Hudson · 2022-06-29 21:51
Relevant parts of config:
(defun ph/font-available-p (font-name)
"Determine whether FONT-NAME is installed."
(find-font (font-spec :name font-name :weight 'normal :slant 'normal :size 16)))
(defun ph/setup-frame-font ()
"Choose best available font."
(set-frame-font
(-some #'ph/font-available-p
'("Iosevka" "Hack" "Inconsolata-dz" "Deja Vu Sans Mono"))))
(defun ph/setup-frame ()
"Set up frame parameters."
...
(ph/setup-frame-font))
(add-hook 'before-make-frame-hook #'ph/setup-frame)
In `~/.Xdefaults`:
emacs*font: Iosevka-16
Emacs.FontBackend: xft,x
I imagine this latter is now redundant, but is it actually wrong?
frozeninfate · 2022-06-29 22:55
You seem to be calling `set-frame-font` in `before-make-frame-hook`? Maybe it should be in `after-make-frame-functions`
Phil-Hudson · 2022-06-29 23:15
You know, I think you're right. Which implies that this code has never done what I thought it was doing! Which in turn implies that I can probably just delete it. I'll comment it out first and see what happens. Thanks.