Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-02-23 02:26:27

jyoung
Member
Registered: 2017-08-11
Posts: 27

emacs not finding fonts

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

#2 2019-02-24 16:43:26

Mellowbob
Member
Registered: 2011-10-16
Posts: 286

Re: emacs not finding fonts

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

#3 2019-02-25 05:18:41

jyoung
Member
Registered: 2017-08-11
Posts: 27

Re: emacs not finding fonts

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

#4 2019-02-25 12:33:50

alcornoqui
Member
Registered: 2014-07-28
Posts: 831

Re: emacs not finding fonts

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

#5 2019-03-01 07:46:23

jyoung
Member
Registered: 2017-08-11
Posts: 27

Re: emacs not finding fonts

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

#6 2019-03-13 13:15:33

linux91
Member
Registered: 2019-03-13
Posts: 3

Re: emacs not finding fonts

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

Board footer

Powered by FluxBB