Discussion:
My theme's default face is ignored
(too old to reply)
Lucas Levrel
2018-09-21 16:18:38 UTC
Permalink
Hi,

(This question was first asked in fr.comp.applications.emacs, then on
stackexchange, with no luck. I'm hoping to find here a knowledgeable guru,
because I'm very lost !)

I recently changed my Linux distribution (from an old Opensuse 13.1 to
Linux Mint 19, which comes with "GNU Emacs 25.2.2 of 2017-09-22, modified
by Debian"), and now my very basic theme is not working correctly anymore.
My theme file is only this:
---
(deftheme Labo
"Created 2017-02-16.")

(custom-theme-set-variables 'Labo
'(default-frame-alist (quote ((tool-bar-lines . 0) (height . 57)
(menu-bar-lines . 1) (width . 82)
(vertical-scroll-bars . right)))))

(custom-theme-set-faces 'Labo
'(default ((t (:height 113 :foundry "1ASC"
:family "Droid Sans Mono Slashed")))))

(provide-theme 'Labo)
---

My theme is correctly loaded from .emacs: M-x customize-themes shows it
checked. M-x describe-variable default-frame-alist gives the correct value
(as defined in the theme). But M-x describe-face default gives:
---
Family: DejaVu Sans Mono
Foundry: PfEd
Height: 98
---

However, changing the default face by hand in Customize works, so I guess
the "Droid Sans Mono Slashed" font is not the culprit.

I'm far from being an Emacs expert. Maybe a loading order issue? The
requested font is a TrueType one, placed in ~/.fonts.

There is no error in Messages. How to debug this? Thanks for your help.
--
LL
Ἕν οἶδα ὅτι οὐδὲν οἶδα (Σωκράτης)
j***@tin.org
2018-09-22 19:29:58 UTC
Permalink
Post by Lucas Levrel
However, changing the default face by hand in Customize works, so I guess
the "Droid Sans Mono Slashed" font is not the culprit.
I'm far from being an Emacs expert. Maybe a loading order issue? The
requested font is a TrueType one, placed in ~/.fonts.
# update fonts.dir,fonts.scale
mkfontscale ~/.fonts
mkfontdir ~/.fonts

#change the font path
xset +fp ~/.fonts
xset fp rehash

and try

emacs -fn fontname

The names are in fonts.dir
Lucas Levrel
2018-09-25 14:35:03 UTC
Permalink
Addendum: the problem is not specific to theming. Setting the default face
to "Droid Sans Mono Slashed" in .emacs doesn't work either.
Post by j***@tin.org
Post by Lucas Levrel
However, changing the default face by hand in Customize works, so I guess
the "Droid Sans Mono Slashed" font is not the culprit.
I'm far from being an Emacs expert. Maybe a loading order issue? The
requested font is a TrueType one, placed in ~/.fonts.
# update fonts.dir,fonts.scale
mkfontscale ~/.fonts
mkfontdir ~/.fonts
Then run emacs, the theme's font setting is applied. I can stop and start
emacs several times, it works.

*But* at the next login, this will not work anymore! I can make it work
again by... removing fonts.dir and fonts.scale! This somehow "awakens"
some part of X, because the display of other apps (Zim, Xfce Terminal)
which use a different font (DejaVu) is altered (somewhat shrinked) when I
remove these files.
Post by j***@tin.org
#change the font path
xset +fp ~/.fonts
xset fp rehash
don't help in any case.
Post by j***@tin.org
emacs -fn fontname
always works, even without fonts.* files or invoking xset. So I can
workaround the problem by manually setting the theme's font, but this
doesn't solve or explain the issue...
--
LL
Ἕν οἶδα ὅτι οὐδὲν οἶδα (Σωκράτης)
Loading...