"Stephen J. Turnbull" <stephen(a)xemacs.org> writes:
(It actually looks a fair amount like font.el as an API, but I
don't
know how much "bloat" it would add to XEmacs.)
Note that, when I referred to font.el as "bloat", I was referring not
to its size, but to the fact that we needed only a small subset of its
functionality. I now know that part of it is already available in
`x-face.el', and that the other part could have been obtained through
the `font-instance-properties' alist. I wish I'd known it then.
The harder problem was that querying for font properties is not very
useful if you cannot also set them, which really had nothing to do
with font.el.
For example, why doesn't make-face-bold use font.el? Why does
make-face-font have to be so hairy? Why does it have to even exist?
There should IMHO be a set-face-bold-p, which should do exactly what
set-face-underline-p and friends do: change a specifier's value. It
should be up to the display code to use the value when choosing the
font to draw the face with. The horror that is make-face-bold,
make-face-family (who the hell invented *that* name?
**set**-face-family, anyone?) must go away if we're to have a sane
face API.
For example, it should be possible to do this:
(let ((face (make-face (gensym) nil t)))
(set-face-bold-p face t)
(put (make-extent (point-min) (point-max)) 'face face))
and end up with a buffer whose characters are drawn in bold versions
of their respective fonts. (On a TTY, it should draw highlighted
characters.) And that should, of course, be exactly equivalent to:
(put (make-extent (point-min) (point-max)) 'face 'bold)
because the `bold' face should be nothing other than a face with the
`bold' property set to t, such as the temporary I generated with
`make-face' in the above example. Of course, the second form works
even now, but with subtly different semantics: it draws all characters
in the buffer with *the same* font: that of the `bold' face. Bad.
The same should be possible with all font properties, e.g. family,
size, slant, and possibly even "antialiasing"! I can easily imagine
that I'd want antialiasing for one buffer or face, and not want for
others. The power behind specifiers might for once actually be put to
good use.
If it sounds hairy for the display code to merge fonts on the fly, it
may be true. But implementing that hairiness is time well-spent
because it would allow the interface to be simple. And it's not like
our display code doesn't look for fonts at redisplay time anyway,
e.g. for Mule. FSF Emacs 21 does it like that, and so should we.
All this was discussed several years ago, and there was consensus that
the approach I advocated was a Good Thing. But I didn't have enough
knowledge to implement it then, and I'm far from convinced that I
could do it now. Also, I wasn't sure at the time if it's a good idea
to introduce font properties as face properties, or whether we should
use a "font" abstract type and allow the user to change its
attributes. After having seen how it works in Emacs 21, I don't have
a problem with "faces" equally treating font properties (size, weight,
slant) and non-font ones (color, underline, antialiasing).
I was being a little unfair. I'm using "available to the
users" as a
heuristic for the kinds of reasons you didn't use the GNU names
Note that those functions were originally written by Per Abrahamsen
for Custom, hence the custom- prefix. I simply didn't want to drop
the prefix without also fixing them. I never did fix them, so the
prefix stayed.
for the similar functions in XEmacs -- it's incomplete, a hack,
doesn't really address the needs (of Mule users, in my case).
Ouch. Have you tried talking to Mr. Handa and Stallman about it?