Implementation of :inherit parameter for faces
"Ben Wing" <[email protected]> Wed, 16 Feb 2005 00:16:24 -0600
| Newsgroups | gmane.emacs.xemacs.design |
|---|---|
| Message-ID | <004201c513ef$0c1e21e0$220110ac@neeeeeee2> |
I notice that my new font-lock port requires the :inherit face property. The idea seems to be that faces under GNU Emacs are now specified through a series of attributes, the importance of which is that fonts have been exploded into a whole series of new properties -- slant, weight, height, family, etc. In GNU Emacs the code to combine them happens at the C code. In our C code, the font is just a unified font spec, although there are nasty functions to `make-font-smaller' etc. There also exist, in our C code, inheritance which is in some way more powerful than FSF [individual properties can each inherit from some other face, even from a differently-named property if there is semantic equivalency]. FSF has only a single :inherit attribute, which is not as powerful as what is just mentioned but more convenient to specify and more powerful in that the font properties have been split out. Currently we have Lisp code to combine multiple face properties to generate a display face (e.g. multiple faces may overlay a particular region of text, and in general faces need not specify values for all possible properties, so one might specify a only foreground color, another a font, and a third a background pixmap, and the resulting text has all three properties applied). It would be very easy to add an `inherit' property (currently inheritance is always from the `default' face), and we could hook the Lisp code into the C code so that we could directly set the exploded properties on faces and have the fonts generated automatically. But it would probably have problems getting proper on-the-fly inheritance of all the various font properties. Doing this right would not be too difficult since all the complex algorithmic stuff is already written, but it would require a bit of work. So ... There are various paths I could take, from doing nothing at all to doing the whole thing, complete and correct, to in-between steps that should be clear from the above discussion. I'd like to hear people's thoughts on [a] how important is this functionality, [b] who would use it, [c] how much of it needs to be implemented, and when [e.g. "While you're at it, do it right" or "Just put in a minimal hack to get font-lock minimally working, then worry about it properly later." Ben