Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"Invalid face slant: roman"

8 views
Skip to first unread message

Zoran Rilak

unread,
Feb 24, 2008, 12:54:35 AM2/24/08
to
Hello,

I've just checked out the latest Emacs 23.0.60 from the CVS trunk (as
of 2008-02-23) and compiled it with fontconfig support (--enable-font-
backend). When I try to use any of the fonts provided via fontconfig
to customize default face, here's what happens:

- the font loads and Emacs redraws itself correctly.
- when I do a customize-face default, I see that it longer parses
correctly in the custom-mode; instead of a list of checkboxes and
values, I get a "Lisp expression:" field.
- :slant is set to "roman" regardless of its former value (before
changing :family). This goes for every fontconfig family I've tried
so far.
- If I save this customization and restart Emacs, I get a message
"Invalid face slant: roman". The face does not get applied.
- Also: sometimes my mode-line face will have its foreground reset
to #000000 after applying the new default face.

This wasn't an issue with an earlier Emacs 23.0, also from CVS
(although that one I had to start with --enable-font-backend argument
to get the fc backend; apparently no longer needed).

I found this in lisp/ChangeLog:

2008-02-01 Kenichi Handa <ha...@m17n.org>

* faces.el (font-weight-table): Treat regular and normal as
the
same as medium.
(font-slant-table): Add (roman . 100).

Removing the (roman . 100) part from the font-slant-table does nothing
interesting.

I'm willing to tinker with the source code if someone has an idea what
I should look at first.

Thanks for your time,
Zoran

mi...@trausch.us

unread,
Mar 1, 2008, 12:42:37 PM3/1/08
to
On Feb 24, 12:54 am, Zoran Rilak <zoran.ri...@gmail.com> wrote:
>   - If I save this customization and restart Emacs, I get a message
> "Invalid face slant: roman".  The face does not get applied.
>   - Also: sometimes my mode-line face will have its foreground reset
> to #000000 after applying the new default face.

I have the same issue here. Here is the debugger output and the
custom-set-faces section of my ~/.emacs file:

Debugger entered--Lisp error: (error "Invalid face slant" roman)
internal-set-lisp-face-attribute(default :slant roman #<frame
emacs@sage 0x8bdfaf8>)
set-face-attribute(default #<frame emacs@sage 0x8bdfaf8> :slant
roman)
face-spec-set-2(default #<frame emacs@sage 0x8bdfaf8> ((t :stipple
nil :background "white" :foreground "black" :inverse-video nil :box
nil :strike-through nil :overline nil :underline nil :slant
roman :weight normal :height 83 :width normal :family "unknown-dejavu
sans mono")))
face-spec-recalc(default #<frame emacs@sage 0x8bdfaf8>)
face-spec-set(default ((t (:stipple nil :background
"#000000" :foreground "#ffffff" :inverse-video nil :box nil :strike-
through nil :overline nil :underline nil :slant normal :weight
normal :height 90 :width normal :family "Monospace"))) t)
custom-theme-set-faces(user (default ((t ...))) (font-lock-comment-
face ((t ...))) (font-lock-keyword-face ((... ...))) (font-lock-type-
face ((... ...))) (highlight ((... ...))) (minibuffer-prompt
((... ...))) (mode-line ((... ...))) (variable-pitch ((t ...))))
apply(custom-theme-set-faces user ((default (...)) (font-lock-
comment-face (...)) (font-lock-keyword-face (...)) (font-lock-type-
face (...)) (highlight (...)) (minibuffer-prompt (...)) (mode-line
(...)) (variable-pitch (...))))
custom-set-faces((default ((t ...))) (font-lock-comment-face
((t ...))) (font-lock-keyword-face ((... ...))) (font-lock-type-face
((... ...))) (highlight ((... ...))) (minibuffer-prompt ((... ...)))
(mode-line ((... ...))) (variable-pitch ((t ...))))
eval-buffer(#<buffer *load*> nil "/home/mbt/.emacs" nil t) ;
Reading at buffer position 5999
load-with-code-conversion("/home/mbt/.emacs" "/home/mbt/.emacs" t t)
load("~/.emacs" t t)
#[nil [Lots of binary output]] [init-file-user system-type user-init-
file-1 user-init-file otherfile source ms-dos "~" "/_emacs" windows-nt
directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\
\.elc?\\)?$" "~/_emacs" vax-vms "sys$login:.emacs" "/.emacs" t load
expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-
extension "elc" file-name-sans-extension ".el" file-exists-p file-
newer-than-file-p message "Warning: %s is newer than %s" sit-for 1
"default" alt inhibit-default-init inhibit-startup-screen] 7]()
command-line()
normal-top-level()

(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:stipple nil :background "#000000" :foreground
"#ffffff" :inverse-video nil :box nil :strike-through nil :overline
nil :underline nil :slant normal :weight normal :height 90 :width
normal :family "Monospace"))))
'(font-lock-comment-face ((t (:foreground "DeepSkyBlue1" :weight
bold))))
'(font-lock-keyword-face ((((class color) (min-colors 88) (background
dark)) (:foreground "Cyan1" :weight bold))))
'(font-lock-type-face ((((class color) (min-colors 88) (background
dark)) (:foreground "PaleGreen" :slant italic))))
'(highlight ((((class color) (min-colors 88) (background dark))
(:background "blue"))))
'(minibuffer-prompt ((((background dark)) (:foreground "cyan" :height
100 :family "FreeSans"))))
'(mode-line ((((class color) (min-colors 88)) (:background
"blue" :foreground "white" :box (:line-width -1 :style released-
button) :height 100 :width normal :family "FreeSans"))))
'(variable-pitch ((t (:family "FreeSans")))))

mi...@trausch.us

unread,
Mar 1, 2008, 7:37:45 PM3/1/08
to
On Mar 1, 12:42 pm, m...@trausch.us wrote:
> On Feb 24, 12:54 am, Zoran Rilak <zoran.ri...@gmail.com> wrote:
>
> >   - If I save this customization and restart Emacs, I get a message
> > "Invalid face slant: roman".  The face does not get applied.
> >   - Also: sometimes my mode-line face will have its foreground reset
> > to #000000 after applying the new default face.
>

To fix, add:

{"roman", XLFD_SLANT_ROMAN, &Qnormal}

To the table for slants in xfaces.c. This may not be the _proper_
fix, but it does fix the issue and now my Emacs works again as it
should be working.

See https://bugs.edge.launchpad.net/ubuntu/+source/emacs-snapshot/+bug/197366
for the full diff on that file, both just for the source code and for
the Ubuntu package for Hardy Heron.

Suno Ano

unread,
Apr 17, 2008, 4:02:28 PM4/17/08
to bug-gn...@gnu.org
>| On Sat, 1 Mar 2008 16:37:45 -0800 (PST),
>| mike
>| from the organization of http://groups.google.com
>| who can be reached at: mi...@trausch.us
>| (whose comments are cited below with " Mike> "),
>| had this to say in article <65e895c6-7c87-4b0a...@b1g2000hsg.googlegroups.com>
>| in newsgroups gmane.emacs.bugs
>| concerning the subject of Re: "Invalid face slant: roman"
>| (see <c26ecd7c-70c5-41f8...@p73g2000hsd.googlegroups.com> <ff54b12a-feff-4998...@s37g2000prg.googlegroups.com> for more details)

Mike> To fix, add: {"Roman", XLFD_SLANT_ROMAN, &Qnormal}

Mike> To the table for slants in xfaces.c. This may not be the _proper_
Mike> fix, but it does fix the issue and now my Emacs works again as it
Mike> should be working.

This bug seems to be sill present since I am with current Emacs CVS on
DebianGNU/Linux and I have this issue as well ...

Can anyone confirm this?

Bruce Stephens

unread,
Apr 18, 2008, 7:30:15 AM4/18/08
to bug-gn...@gnu.org
Suno Ano <suno...@googlemail.com> writes:

I just tried remving my local copy of the fix, and emacs still worked.
So I think it's been fixed. (At least with the configuration I have,
which previously failed with that error.)


0 new messages