Aptix8 · 2022-09-07 08:42
Hello. I have noticed a strange behavior in Emacs when setting the default font:
I noticed that when using ```set-face-attribute```, the font gets overridden. I tried with a blank init file and I discovered that it happens due to the line ```(require 'use-package)```. If I call ```set-face-attribute``` before that line, everything is ok, but if I call it afterwards, the font gets overridden to the default font of the system.
Moreover, if I use ```(add-to-list 'default-frame-alist '(font . "FONT"))```, everything works just fine, regardless of where I declare it.
Anyone knows why this happens?
I have noticed that David Wilson from System Crafters calls ```(require 'use-package)``` and sets the font by ```set-face-attribute``` later with no issues, so I don't know why my system behaves otherwise.
By the way, I get the same behavior in Kubuntu and in Windows 10.
Thanks in advance!
flexibeast · 2022-09-07 23:13
My guess is that what's happening is that you have some package installed that is causing this behaviour, and that the `(require 'use-package)` call 'causes' it in the sense that it causes your installed packages to be loaded and initialised. That would explain why it happens for you and not for David Wilson.
Try bisecting your `use-package` configuration to narrow down where the problem arises.
Aptix8 · 2022-09-08 05:39
But I did it with an empty ini.el file. Only had the font initialisation and the initialisation of ```use-package```.
flexibeast · 2022-09-08 05:42
Oh i see, sorry for misunderstanding. - Are you using the same version of `use-package` as Wilson?
Aptix8 · 2022-09-08 06:23
I don't know, but I noticed that the manual points to ```default-frame-alist``` and not to ```set-face-attribute``` in orther to specify the font: https://www.gnu.org/software/emacs/manual/html_node/emacs/Fonts.html