Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

emacs does not uses fonts from /usr/share/fonts

Tags:

emacs

fonts

Can't win in emacs font battle under Debian Linux+fluxbox.

Should be mentioned that I have absolutely no expirience in fontconfig, so mb I am missing something obvious.

I am trying to use some system fonts from /usr/share/fonts like DejaVu under emacs but no luck.

I tried:

1. Mentioned on many resources commands like

(set-default-font "DejaVu Sans Mono-12")

returns "Font not available" for almost any fontname I tried.

2.

Shift+Mouse-Left-Click->Change Text Font ->

gives very little list of available fonts with two or three and different sizes.

3. I tried:

ln -s /usr/share/fonts ~/.fonts

and nothing

4. tried using xset method for(found such method on archlinux wiki and blindly tested):

cd /usr/share/fonts/truetype/ttf-dejavu
sudo mkfontdir
xset +fp /usr/share/fonts/truetype/ttf-dejavu
xset fp rehash

nothing

5. I even straced emacs for any acces to directories with font name:

2>&1 strace -f emacs-24.3.1 > ./t.txt

but

grep -i font ./t.txt

gives only:

[pid 18809] writev(3, [{"b\1\6\0\17\0\1\0", 8}, {"XFree86-Bigfont", 15}, {"\0", 1}], 3) = 24

and nothing about directories like ~/.fonts or /usr/share/fonts

At the same time:

% fc-list|grep -c deja  
42

How does it work?:( Mb i dont understand some main idea?

UPDATE: I've used opensoop -v to monitor what path uses emacs on my laptop (under os x) to get fonts but this has nothing with linux paths ofc:(

Can someone under the linux trace emacs for opening fonts to give a hint what paths I should configure.

2>&1 strace -f  emacs |grep -i font

will be enough i think

like image 288
sohel Avatar asked Aug 09 '13 14:08

sohel


1 Answers

Was my fault.

I'v checked with ldd command and saw that there was no dependecny from libfreetype.

And only configuration like:

./configure --with-x-toolkit=gtk

added freetype library dependency to binary. So from now it is ok.

One more thing to notice about "default system emacs" errors. Emacs binary i thought was the system one,was also custom builded long time ago (also without freetype support), and according to my paths configurations this custom one was executed when I simply typed "emacs" without path specification.

I am very shame, sorry for such misconfiguration. To be honest its very strange that no default freetype support is configured.

like image 73
sohel Avatar answered Oct 14 '22 20:10

sohel