emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `set-frame-font' doesn't support font aliases


From: Kenichi Handa
Subject: Re: `set-frame-font' doesn't support font aliases
Date: Tue, 03 Jun 2008 16:44:14 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

In article <address@hidden>, Stefan Monnier <address@hidden> writes:

>>> The current code for `set-frame-font' doesn't support font
>>> aliases - for example, these sexps don't work:

>>> (set-frame-font "5x7")    ;; error: "Font `5x7' is not defined"
>>> (set-frame-font "fixed")  ;; uses some unexpected font

> > I've just installed a fix to check also an alias name in X
> > font-backend.  But, as Emacs accepts a fontconfig-style font
> > name too, for instance, "fixed" is parsed as a font of
> > family "fixed" which may match with many fonts.

> > Is keeping backward compatibility of (set-frame-font
> > "fixed") important enough to drop the support of
> > fontconfig-style name?

> Can you recover the Emacs-22 behavior by restricting the backends to
> just `x'?

No, because the font-name parser is independent of font
backends; i.e. even if you use only x font-backend, you can
specify a font name as, for instance,
"fixed-12:foundry=misc".

It is possible to implement a new method
`resolve_alias_name' for a font-backend, and add a new
function font-resolve-alias-name.

Then one can do:
 (set-frame-font (font-resolve-alias-name "fixed")).

Another idea is to do:
  (set-frame-font (font-spec :alias "fixed)).
or
  (set-frame-font ":alias=fixed")

---
Kenichi Handa
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]