In the medium term, this is the right way to handle this.
The main question is whether fonts need to exist as a
separate entity exposed as a public API; I would say "no".
Lisp should specify properties of faces, then the internals
(which might also be an internal Lisp API, of course) should
dispatch out to platform facilities to get fonts, colors,
background pixmaps, theme songs (to be automagically played
when point enters the extent ;-), etc., and combine them into a face.
My intent is to implement something that's basically compatible with the way
GNU Emacs does things, which means that you can explicitly specify a font
name if you want (esp. an XLFD), and if so, it overrides the
height/weight/width/slant/family properties. We'd have to do something like
this anyway for backwards compatibility.
Ben> [c] how much of it needs to be implemented, and when
"Just put in a minimal hack to get font-lock minimally
working, then worry about it properly later." is my offhand
preference because I think there are design issues that
deserve thought, even sleeping on, because of the nuisance
differences among MSW, fontconfig, and Carbon.
I'm not sure how many design issues there really are. I think the GNU Emacs
external API is basically the right way to go; I may not duplicate it
exactly (e.g. stuff like `set-face-attribute' vs. our `set-face-property')
but it will follow the same lines -- basically just expanding the existing
face properties and probably implementing property aliases to follow the GNU
Emacs names (stipple vs. background-pixmap, strike-through vs. "strikethru"
-- blame Bill Perry for that last one). Actually adding these properties is
not hard. I've already created a face-slots.h to abstract away the actual
existing properties, so new ones can easily be added. Once this structure
is present, doing the underlying implementation for Windows will be trivial
because there is built-in support for specifying fonts through parameters
and the GDI automatically finds the closest one. Maybe fontconfig is the
same. For XLFD, I'll probably end up copying the GNU Emacs code.
For the moment I'm just implementing the `inherit' parameter. This is going
into my `fixup' ws but it will probably be easy to extract it out, and it
could be checked in soon, so that others can test the new font-lock.