Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
emacs fonts not found
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 438

PostPosted: Sat Feb 09, 2019 3:33 pm    Post subject: emacs fonts not found Reply with quote

Hi Folks,

I'm working on a recently installed gentoo system, and I'm having trouble with fonts in emacs. The default font loads fine, but when I try to increase the font size or change fonts, emacs either doesn't respond or turns the characters into the rectangles that are displayed when a font can't be found.

There are lots of posts about similar problems, but I've tried the solutions and none seems to work. A common answer is to re-emerge emacs with new use flags. Here are some USE flag combinations that I've tried:

athena Xaw3d -gtk xft
xft
gtk gsettings gconf xft

Despite the range, the effect is always the same. Does anyone have any clue what might be going on? Thanks!
Back to top
View user's profile Send private message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 438

PostPosted: Sat Feb 09, 2019 8:27 pm    Post subject: Reply with quote

I'm not sure if this is related, but I also get this warning on the terminal when my mouse passes over the emacs windows:

Gtk-CRITICAL **: 15:26:16.332: gtk_distribute_natural_allocation: assertion 'extra_space >= 0' failed
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Mon Feb 11, 2019 2:01 am    Post subject: Reply with quote

Hi jyoung,

I'm not an Emacs expert. But I tried to reproduce the problem you reported.
  1. I emerged Emacs with USE flag 'xft'. To be precise, I built Emacs with the USE flags below:
    Code:
    X acl alsa gpm inotify jpeg lcms png ssl svg systemd threads tiff xft xpm zlib -Xaw3d -aqua -athena -cairo -dbus -dynamic-loading -games -gconf -gfile -gif -gsettings -gtk -gtk2 -gzip-el -imagemagick -kerberos -libxml2 -livecd -m17n-lib -mailutils -motif -selinux -sound -source -toolkit-scroll-bars -wide-int -xwidgets

  2. I started Emacs with
    Code:
    emacs -fn 'Noto Sans'

  3. I increased and decreased the font size using C-x C-+ and C-x C-
On my machine, everything works as expected. Is that the scenario where you have problems? If not: please describe eactly how I can reproduce the problems you reported.

Mike
Back to top
View user's profile Send private message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 438

PostPosted: Tue Feb 12, 2019 2:54 am    Post subject: Reply with quote

mike155,

I recompiled emacs with exactly those flags, and when I tried to launch it with that command it returned:
Font ‘Noto Sans’ is not defined

and then failed to launch. This really speaks to some missing font library.
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Tue Feb 12, 2019 8:48 am    Post subject: Reply with quote

Quote:
Font ‘Noto Sans’ is not defined

It probably just means that font 'Noto' is not installed on your machine.

You could install it: 'emerge noto'. Alternatively, you could tell me the font you use.

It's important that we agree on a font. There are many fonts out there. Some aren't scalable or have other problems.
Back to top
View user's profile Send private message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 438

PostPosted: Tue Feb 12, 2019 9:34 pm    Post subject: Reply with quote

I will confess some ignorance of system fonts and such. On my previous gentoo machine, emacs was able to find the necessary fonts without twiddling anything. How do I determine this?
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Tue Feb 12, 2019 9:44 pm    Post subject: Reply with quote

It could well be that you configured your machine in a way that emacs uses a bitmapped font. In that case it's no wonder that scaling up/down doesn't work. It could also be that your emacs uses a scalable font and that something else is wrong.

But I cannot look into your system. If you want me to help you, you should make sure that your emacs uses a scalable TTF or OTF font. And you should tell me the font your emacs uses. Otherwise I cannot help you.
Back to top
View user's profile Send private message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 438

PostPosted: Wed Feb 13, 2019 4:41 am    Post subject: Reply with quote

In emacs, under the Fontset menu, I see:
startup: 13-dot-medium
standard: 16-dot medium

and under the Misc menu I see:
lucidsanstypewriter
lucidsanstypewriter-bold
sony
clean
fixed
default

But selecting these has no effect on the actual font rendered. These are just internal emacs labels for system fonts, though, yes?

As for the fonts installed on my system, I ran
Code:
qlist -Iv | grep font
and got this
Code:

app-eselect/eselect-fontconfig-1.1-r1
dev-java/fontbox-1.7.1-r1
dev-java/fontbox-1.8.11
dev-texlive/texlive-fontsextra-2017
dev-texlive/texlive-fontsrecommended-2017
dev-texlive/texlive-fontutils-2017
media-fonts/dejavu-2.37
media-fonts/encodings-1.0.4-r3
media-fonts/font-util-1.3.1
media-fonts/stix-fonts-2.0.0
media-fonts/urw-fonts-2.4.9
media-libs/fontconfig-2.13.1-r2
virtual/ttf-fonts-1-r1
x11-apps/mkfontdir-1.0.7
x11-apps/mkfontscale-1.1.3
x11-libs/libfontenc-1.1.3-r1
x11-libs/libXfont2-2.0.3-r1
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Wed Feb 13, 2019 12:51 pm    Post subject: Reply with quote

It seems that you have "Stix 2" fonts installed.

Please run
Code:
emacs -fn 'STIX Two Text'

and tell me what you see

1) Does emacs use Stix fonts now?

2) If you press C-x C-+ or C-x C--: Do the fonts scale up and down? Do characters and words look fine? Or do you get artifacts like rectangles or boxes?
Back to top
View user's profile Send private message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 438

PostPosted: Wed Feb 13, 2019 3:07 pm    Post subject: Reply with quote

Okay, trying that I get:

Font ‘STIX Two Text’ is not defined

It sounds like I have this font installed but emacs isn't connecting to it. Currently my emacs is installed with the same use flags as yours.
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Wed Feb 13, 2019 3:34 pm    Post subject: Reply with quote

Let's try to find out what is wrong.

1) What is the output of:
Code:
fc-list | grep -i Stix

You should get:
Code:
/usr/share/fonts/stix-fonts/STIX2Text-Regular.otf: STIX Two Text:style=Regular
/usr/share/fonts/stix-fonts/STIX2Text-BoldItalic.otf: STIX Two Text:style=Bold Italic
/usr/share/fonts/stix-fonts/STIX2Math.otf: STIX Two Math:style=Regular
/usr/share/fonts/stix-fonts/STIX2Text-Italic.otf: STIX Two Text:style=Italic
/usr/share/fonts/stix-fonts/STIX2Text-Bold.otf: STIX Two Text:style=Bold


2) Please post the ouput of
Code:
emerge --info
Back to top
View user's profile Send private message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 438

PostPosted: Thu Feb 14, 2019 4:44 am    Post subject: Reply with quote

1)
Code:
fc-list | grep -i Stix

return the same as yours

2)
Code:
emerge --info

returns:
Code:
Portage 2.3.59 (python 3.6.6-final-0, default/linux/amd64/17.0/desktop, gcc-8.2.0, glibc-2.28-r5, 4.18.13-gentoo x86_64)
=================================================================
System uname: Linux-4.18.13-gentoo-x86_64-Intel-R-_Core-TM-_i5-7500_CPU_@_3.40GHz-with-gentoo-2.6
KiB Mem:     8023180 total,    233924 free
KiB Swap:    1048572 total,   1048572 free
Timestamp of repository gentoo: Thu, 31 Jan 2019 14:30:01 +0000
Head commit of repository gentoo: d5743ab3330c732b147ad6dd550e62dcb0c483cf
sh bash 5.0_p2
ld GNU ld (Gentoo 2.31.1 p5) 2.31.1
app-shells/bash:          5.0_p2::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.28.0::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.6::gentoo
dev-util/cmake:           3.13.3::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.40.3::gentoo
sys-apps/sandbox:         2.15::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r3::gentoo
sys-devel/gcc:            8.2.0-r6::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.20::gentoo (virtual/os-headers)
sys-libs/glibc:           2.28-r5::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts:

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native"
CHOST="x86_64-pc-linux-gnu"
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Thu Feb 14, 2019 3:43 pm    Post subject: Reply with quote

jyoung: I'm afraid I can't help you. I tried to reproduce the problems you posted (boxes instead of characters and "emacs -fn 'STIX Two Text'" won't start), but no matter what I do, I cannot reproduce this problem.

Just a few random thoughts:
  • Did you install or configure infinality?

  • Create a new user and start emacs from this user. Do you still see the problems you reported?

  • When you run "emerge emacs", you will see some status messages from configure. Look at the two messages below:
    Code:
      Does Emacs use -lfreetype?         yes
      Does Emacs use -lxft?              yes

    Do you see 'yes' on both lines on your machine? If you see "no" on one of the lines, emacs won't be able to display Truetype fonts.

  • Do you really need emacs? If you just chose emacs because you needed an editor, you could try a more modern editor like 'kate'.
Back to top
View user's profile Send private message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 438

PostPosted: Fri Feb 15, 2019 5:40 pm    Post subject: Reply with quote

infinality is not installed on my system. The only package on my system that has the infinality use flag is media-libs/freetype, and it's turned off.

I created a new user, and the emacs had the same issue. I also have gentoo installed on another machine at work, and the problem exists there too. The system is setup similarly, but not exactly the same. And, weirdly, emacs worked fine for over a year until a recent update (emerge --update --deep --newuse world).

Yes, I see both of those messages when I emerge emacs.

This looks like a very strange problem!
Back to top
View user's profile Send private message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 438

PostPosted: Sat Feb 23, 2019 2:43 am    Post subject: Reply with quote

mike155, what desktop are you running? The is a longshot, but maybe that has something to do with it. I'm running xfce.
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Sat Feb 23, 2019 4:47 pm    Post subject: Reply with quote

I run KDE. In case of problems, I switch to weston or twm.

You could try twm - it's tiny and easy to install. Install packages 'twm' and 'xterm'. Write 'exec twm' to your .xinitrc. Start twm with 'startx' from a Linux text console. You will get a black screen. If you press the left mouse key, you will get a menu. Select 'xterm'. In the xterm window, enter 'emacs' to start Emacs. Press Alt-Ctrl-Backspace to return to your text console.
Back to top
View user's profile Send private message
dpaddy
Tux's lil' helper
Tux's lil' helper


Joined: 25 Jun 2008
Posts: 142

PostPosted: Sun Feb 24, 2019 11:09 pm    Post subject: Reply with quote

Sorry if I'm contributing noise... I run fluxbox and the following seem to work for me
Code:
emerge -vp fluxbox

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] x11-wm/fluxbox-1.3.7-r3::gentoo  USE="imlib nls slit systray toolbar truetype -bidi -vim-syntax -xinerama" 0 KiB

Code:
qlist -Iv | grep font
app-eselect/eselect-fontconfig-1.1
dev-texlive/texlive-fontsrecommended-2017
dev-texlive/texlive-fontutils-2017
media-fonts/corefonts-1-r7
media-fonts/encodings-1.0.4-r3
media-fonts/font-adobe-100dpi-1.0.3-r1
media-fonts/font-alias-1.0.3-r1
media-fonts/font-bh-100dpi-1.0.3-r1
media-fonts/font-bitstream-100dpi-1.0.3-r1
media-fonts/font-misc-misc-1.1.2-r1
media-fonts/font-util-1.3.1
media-fonts/ipamonafont-1.0.8
media-fonts/ja-ipafonts-003.02-r1
media-fonts/liberation-fonts-2.00.1-r3
media-fonts/urw-fonts-2.4.9
media-libs/fontconfig-2.13.0-r4
virtual/ttf-fonts-1-r1
x11-apps/mkfontdir-1.0.7
x11-apps/mkfontscale-1.1.3
x11-apps/xfontsel-1.0.6
x11-libs/libfontenc-1.1.3-r1
x11-libs/libXfont2-2.0.3-r1
Code:
 # emerge -vp emacs

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] app-editors/emacs-26.1-r3:26::gentoo  USE="X acl alsa gif gpm imagemagick inotify jpeg png ssl svg threads tiff xpm zlib -Xaw3d (-aqua) -athena (-cairo) -dbus -dynamic-loading -games -gconf -gfile -gsettings -gtk -gtk2 -gzip-el -kerberos -lcms -libxml2 -livecd -m17n-lib -mailutils -motif (-selinux) -sound -source -systemd -toolkit-scroll-bars -wide-int -xft -xwidgets" 0 KiB
Code:
 # eselect fontconfig list
Available fontconfig .conf files (* is enabled):
  [1]   09-texlive.conf
  [2]   10-autohint.conf
  [3]   10-hinting-full.conf
  [4]   10-hinting-medium.conf
  [5]   10-hinting-none.conf
  [6]   10-hinting-slight.conf *
  [7]   10-no-sub-pixel.conf
  [8]   10-scale-bitmap-fonts.conf *
  [9]   10-sub-pixel-bgr.conf
  [10]  10-sub-pixel-rgb.conf
  [11]  10-sub-pixel-vbgr.conf
  [12]  10-sub-pixel-vrgb.conf
  [13]  10-unhinted.conf
  [14]  11-lcdfilter-default.conf
  [15]  11-lcdfilter-legacy.conf
  [16]  11-lcdfilter-light.conf
  [17]  20-unhint-small-vera.conf *
  [18]  25-unhint-nonlatin.conf
  [19]  30-metric-aliases.conf *
  [20]  40-nonlatin.conf *
  [21]  45-generic.conf *
  [22]  45-latin.conf *
  [23]  49-sansserif.conf *
  [24]  50-user.conf *
  [25]  51-local.conf *
  [26]  60-generic.conf *
  [27]  60-latin.conf *
  [28]  60-liberation.conf
  [29]  65-fonts-persian.conf *
  [30]  65-khmer.conf
  [31]  65-nonlatin.conf *
  [32]  66-ja-ipafonts.conf
  [33]  69-unifont.conf *
  [34]  70-no-bitmaps.conf
  [35]  70-yes-bitmaps.conf
  [36]  80-delicious.conf *
  [37]  90-synthetic.conf *
Code:
#  tail -n 1 ~/.emacs
(set-frame-font "-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1")
But then again, I almost never know what I'm doing.
Back to top
View user's profile Send private message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 438

PostPosted: Mon Feb 25, 2019 5:14 am    Post subject: Reply with quote

Trying twm produced a strange result. I've actually used twm before on other machines, but not on this one. But, it wouldn't even start. Here's the output of startx:
Code:
xauth:  file /home/jyoung/.serverauth.4520 does not exist


X.Org X Server 1.20.3
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.18.13-gentoo x86_64 Gentoo
Current Operating System: Linux murex 4.18.13-gentoo #10 SMP Thu Jan 24 13:55:30 EST 2019 x86_64
Kernel command line: root=PARTUUID=d8d9f3f4-4bb1-4026-99d4-e0dcadeb06e0 ro
Build Date: 31 January 2019  11:14:22PM
 
Current version of pixman: 0.36.0
   Before reporting problems, check http://wiki.x.org
   to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
   (++) from command line, (!!) notice, (II) informational,
   (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sun Feb 24 19:25:02 2019
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported high keycode 372 for name <I372> ignored
>                   X11 cannot support keycodes above 255.
>                   This warning only shows for the first high keycode.
Errors from xkbcomp are not fatal to the X server
twm:  unable to open fontset "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
xinit: connection to X server lost

waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.


The line where it complained about not being able to connect to a fontset suggests that twm is also having trouble finding system fonts. If that's the case, then I'm glad I poked at this, because it might be more serious than I realized.
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Mon Feb 25, 2019 9:42 am    Post subject: Reply with quote

Quote:
twm: unable to open fontset "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"

That's probably because you didn't install media-fonts/font-adobe-100dpi and media-fonts/font-adobe-75dpi. Install these two packages and that error will disappear.
Back to top
View user's profile Send private message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 438

PostPosted: Thu Feb 28, 2019 4:44 am    Post subject: Reply with quote

I've installed those fonts, and now twm launches. Within twm, emacs works fine. I'm able to change fonts and font sizes. Could the problem be related to xfce?
Back to top
View user's profile Send private message
jyoung
Guru
Guru


Joined: 20 Mar 2007
Posts: 438

PostPosted: Thu Feb 28, 2019 6:04 am    Post subject: Reply with quote

Actually, emacs now behaves in xfce too. It looks like installing the fonts that twm complained about did the trick. Does anyone have any idea why those particular fonts are critical, and if they're critical why they might not have been pulled in by emerge?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum