"Stephen J. Turnbull" <turnbull(a)sk.tsukuba.ac.jp> writes:
>>>>> "Glynn" == Glynn Clements
<glynn(a)sensei.co.uk> writes:
Glynn> Olivier Galibert wrote:
>> Anyone has the slightest idea on how we should handle font
>> selection in XEmacs ? The Emacs fontset approach looks very
>> difficult to use, and you have to provide one for each size you
>> want your characters in. If someday we add truetype support
>> either in the redisplay engine or the X server, the fontset
>> concept explodes.
Glynn> Would Motif's XmString/XmFontList approach work?
A naive implementation would suffer from the same problems as far as I
can tell; an XmFontList seems to based on an XFontSet, and defaults to
rendering X Compound Text using the current locale. A more sophisticated
implementation using tags would require that we add those semantics to
non-Motif X font handling and all Windose font handling. Yuck.
I think we need to decide the semantics we want, redesign it from the
ground up, and then figure out ways to implement on all platforms: TTY,
X, Motif, Windose.
I like the three-dimensional approach in the Options menu (family, size,
weight) for the default; we might want to allow more flexible
specification if the font descriptions will support it (sans- v. serif),
for example. And it would be nice to implement a way to prevent the
server (as much as possible, this being X) from returning scaled versions
of bitmap fonts.
As much as possible, we should make it easier for users and programmers
to select font schemes (so that font sizes and so on can be specified
relative to the buffer's default face) than individual fonts.
Maybe model it on HTML style sheets? Bill Perry has already written code
for dealing with those.
The stuff in font.el that Emacs/W3 and custom-face use is not dependent
on style sheet stuff at all. I wrote that with the intention of eventually
moving it over into C and part of the core redisplay stuff, but I just
haven't had the time.
The problem would be merging properties, ie: you have 2 overlapping
extents, one with 'family=arial', and 'bold' set, the other with
'italic'
and 'size=28pt' set... but I guess we could cache all that somehow. Each
device would have a 'getfont' method that we could pass in an 'EmacsFont'
instance to, and it would just return the closest it could find.
Anybody want to hack on this? i'm not going to have any time for a
while, but I can still throw ideas out. :)
-Bill P.