You are not logged in.
Pages: 1
Hi,
I've just installed xfce on a new system, and emacs is having trouble finding the fonts. There are a lot of threads out there with similar topics, but I've tried all the ideas I can find with no luck.
The symptom is that when I launch emacs, I'm not able to change the font or font size. This is annoying because the only font/font size it seems know is tiny on my screen.
I'm running gentoo, and there's a number of posts about how to install emacs. But, I've been to the gentoo forums, and one individual there compiled emacs with the same flags, and could not produce the problem.
It seems like I have emacs compiled correctly and I have system fonts installed, but emacs isn't connecting to them. If anyone here has any ideas, or can think of any tests I could run, that would be great.
Offline
In my .emacs I have the line
(set-default-font "DejaVu Sans Mono 14")
Adjust as necessary. I don't recall exactly how to determine what fonts you have and their names.
Offline
I don't think it's an issue with setting the default font. I think it's more of an issue of emacs not finding some/most system fonts, and then falling back on something it can find. When I change the default in .emacs, as you suggest, there's no change.
When I change the font size to 18 instead of 14, still no change. Inside emacs, when I try to increase the font size with the left-click menu, there's no change. When I change fonts from within emacs, there's either no change or the characters switch to the number blocks that get shown when a font can't be rendered.
Offline
Does this help? https://old.reddit.com/r/emacs/comments … _in_emacs/
(Disclaimer: I don't use Emacs, just did a search in DuckDuckGo)
Offline
The culprit was missing fonts. I tried emacs from within twm instead of xfce, but twm wouldn't even start, complaining that it could not find these fonts:
media-fonts/font-adobe-100dpi
media-fonts/font-adobe-75dpi
I installed these, and twm started. emacs is also able to see the fonts, both in xfce and twm. I'm still baffled as to why emacs wasn't able to see any of the other system fonts.
Offline
Is it just emacs or is the system not seeing the fonts?
What is the output of:
fc-list | grep [string excerpt from font package]
ex. fc-list | grep DejaVu
maybe: fc-list | grep font-adobe (none of the installed fonts here have this string in them)
If the font does not appear in the output, then it's possible the directory where the fonts are kept is not visible to fontconfig.
To see where the various config files are located use:
sudo find / -name "fonts\.conf" -type f -print
Not using Gentoo, but as an example on this system, installing adobe's 'Source Code Pro' fonts to /usr/share/fonts/local/OTF and ../TTF were not visible to the system once the cache was updated (sudo fc-cache -f -v)
i.e. fc-list | grep -e "[Cc]ode" returned nothing.
The file ~/.config/fontconfig/fonts.conf had to be adjusted to include:
<fontconfig>
<dir>/usr/share/fonts/local/OTF</dir>
<dir>/usr/share/fonts/local/TTF</dir>
<dir>~/.fonts</dir>
</fontconfig>
And then the cache was once again updated:
sudo fc-cache -f -v
Last edited by linux91 (2019-03-13 13:52:25)
Offline
Pages: 1
[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 534.34 KiB (Peak: 535.19 KiB) ]