• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Japanese translation of message catalog for Sawfish Window-Manager


Commit MetaInfo

Révisionf7fae490993a405e1f0c722798058931cd90749a (tree)
l'heure2002-11-03 13:56:15
AuteurJohn Harper <jsh@src....>
CommiterJohn Harper

Message de Log

merged font changes from HEAD

Change Summary

Modification

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
1+2002-11-02 John Harper <jsh@unfactored.org>
2+
3+ * configure.in, config.h.in, Makedefs.in: check for Xft
4+ libraries and headers (merged from HEAD)
5+
16 2002-09-26 Stanislav Brabec <sbrabec@suse.cz>
27
38 * po/cs.po: Updated Czech translation from Miloslav Trmac
--- a/Makedefs.in
+++ b/Makedefs.in
@@ -54,7 +54,7 @@ LIBS=@LIBS@
5454 LIBOBJS=
5555 X11_CFLAGS=@X_CFLAGS@
5656 X11_LIBS=@X_PRE_LIBS@ -lX11 @X_LIBS@ @X_EXTRA_LIBS@
57-EXTRA_X11_LIBS=@XINERAMA_LIBS@ -lXext
57+EXTRA_X11_LIBS=@XINERAMA_LIBS@ @XFT_LIBS@ -lXext
5858 IMLIB_CFLAGS=@IMLIB_CFLAGS@
5959 IMLIB_LIBS=@IMLIB_LIBS@
6060 GDK_PIXBUF_CFLAGS=@GDK_PIXBUF_CFLAGS@
--- a/configure.in
+++ b/configure.in
@@ -98,6 +98,13 @@ AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
9898 AC_CHECK_HEADERS(X11/extensions/Xinerama.h)],
9999 [],[$X_LIBS -lX11 -lXext])
100100
101+XFT_LIBS=""
102+AC_SUBST(XFT_LIBS)
103+AC_CHECK_LIB(Xft, XftDrawCreate,
104+ [XFT_LIBS="-lXft -lXrender"
105+ AC_CHECK_HEADERS(X11/Xft/Xft.h)],
106+ [], [$X_LIBS -lX11 -lXext])
107+
101108 CPPFLAGS="${_cppflags}"
102109
103110 dnl Check for librep
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,34 @@
1+2002-11-02 John Harper <jsh@unfactored.org>
2+
3+ * merged font changes from HEAD:
4+
5+ 2002-11-02 John Harper <jsh@unfactored.org>
6+
7+ * fonts.c, sawmill.h: different font rendering methods are now
8+ better abstracted, using the Lisp_Font_Class structure
9+
10+ (get-font-typed, font-type-exists-p, font-type): new functions,
11+ allows a font to be loaded from a type+name combination,
12+ instead of just a name, which may be ambiguous when multiple
13+ renderers are being used
14+
15+ Current types are "xlfd" for traditional X fonts, and "Xft" for
16+ Xft client-side rendered fonts. The old get-font function
17+ always tries to load xlfd fonts, for backwards compatibility
18+
19+ For now, Xft fonts can be used like this:
20+
21+ (when (and (boundp 'font-type-exists-p)
22+ (font-type-exists-p "Xft"))
23+ (setq default-font (get-font-typed "Xft" "Trebuchet MS-11")))
24+
25+ 2002-11-02 John Harper <jsh@unfactored.org>
26+
27+ * fonts.c (x_draw_string): now takes an explicit foreground
28+ color parameter, instead of using the one in the gc
29+
30+ * x.c, sawmill_subrs.h, functions.c, frames.c: updated callers
31+
132 2002-10-20 John Harper <jsh@unfactored.org>
233
334 * more merging:
--- a/src/fonts.c
+++ b/src/fonts.c
@@ -42,13 +42,80 @@
4242 #include <X11/Xlocale.h>
4343 #include <ctype.h>
4444
45+#ifdef HAVE_X11_XFT_XFT_H
46+# include <X11/Xft/Xft.h>
47+#endif
48+
4549 static Lisp_Font *font_list;
4650 int font_type;
4751
4852 DEFSYM(default_font, "default-font");
4953
54+struct Lisp_Font_Class_struct {
55+ const char *type;
56+ bool (*load) (Lisp_Font *f);
57+ void (*finalize) (Lisp_Font *f);
58+ int (*measure) (Lisp_Font *f, u_char *string, size_t length);
59+ void (*draw) (Lisp_Font *f, u_char *string, size_t length,
60+ Window id, GC gc, Lisp_Color *fg, int x, int y);
61+};
62+
63+
64+/* Xlib font structs */
65+
66+static bool
67+fontstruct_load (Lisp_Font *f)
68+{
69+ XFontStruct *font_struct;
70+
71+ font_struct = XLoadQueryFont (dpy, rep_STR (f->name));
72+
73+ if (font_struct == 0)
74+ return FALSE;
75+
76+ f->font = font_struct;
77+ f->ascent = font_struct->ascent;
78+ f->descent = font_struct->descent;
79+
80+ return TRUE;
81+}
82+
83+static void
84+fontstruct_finalize (Lisp_Font *f)
85+{
86+ XFreeFont (dpy, f->font);
87+}
88+
89+static int
90+fontstruct_measure (Lisp_Font *f, u_char *string, size_t length)
91+{
92+ return XTextWidth (f->font, string, length);
93+}
94+
95+static void
96+fontstruct_draw (Lisp_Font *f, u_char *string, size_t length,
97+ Window id, GC gc, Lisp_Color *fg, int x, int y)
98+{
99+ XFontStruct *fs;
100+ XGCValues gcv;
101+
102+ fs = f->font;
103+
104+ gcv.foreground = fg->pixel;
105+ gcv.font = fs->fid;
106+ XChangeGC (dpy, gc, GCForeground | GCFont, &gcv);
107+
108+ XDrawString (dpy, id, gc, x, y, string, length);
109+}
110+
111+static const Lisp_Font_Class fontstruct_class = {
112+ "xlfd",
113+ fontstruct_load, fontstruct_finalize,
114+ fontstruct_measure, fontstruct_draw,
115+};
116+
50117
51-/* XLFD pattern matching */
118+/* Xlib font sets */
52119
53120 static char *
54121 xlfd_get_element (const char *xlfd, int idx)
@@ -111,7 +178,7 @@ generalize_xlfd (const char *xlfd)
111178 }
112179
113180 static XFontSet
114-x_create_font_set (char *xlfd, char ***missing,
181+x_create_fontset (char *xlfd, char ***missing,
115182 int *nmissing, char **def_string)
116183 {
117184 XFontSet fs = XCreateFontSet (dpy, xlfd, missing, nmissing, def_string);
@@ -171,11 +238,8 @@ x_create_font_set (char *xlfd, char ***missing,
171238 return fs;
172239 }
173240
174-
175-/* font creation */
176-
177-static void *
178-get_font_set (const char *name, int *typep, int *ascentp, int *descentp)
241+static bool
242+fontset_load (Lisp_Font *f)
179243 {
180244 XFontSet font_set;
181245 int ascent, descent;
@@ -183,10 +247,10 @@ get_font_set (const char *name, int *typep, int *ascentp, int *descentp)
183247 char **missing_charset_list, *def_string;
184248 int num_missing_charset_list;
185249
186- font_set = x_create_font_set (rep_STR(name),
187- &missing_charset_list,
188- &num_missing_charset_list,
189- &def_string);
250+ font_set = x_create_fontset (rep_STR (f->name),
251+ &missing_charset_list,
252+ &num_missing_charset_list,
253+ &def_string);
190254
191255 if (font_set != 0)
192256 {
@@ -194,15 +258,17 @@ get_font_set (const char *name, int *typep, int *ascentp, int *descentp)
194258 char **font_names;
195259 int i, j, num_fonts;
196260
261+ f->font = font_set;
262+
197263 num_fonts = XFontsOfFontSet (font_set, &fstrs, &font_names);
198264 ascent = descent = 0;
199265
200266 for (i = 0; i < num_fonts; i++)
201267 {
202268 if (fstrs[i]->ascent > ascent)
203- ascent = fstrs[i]->ascent;
269+ f->ascent = fstrs[i]->ascent;
204270 if (fstrs[i]->descent > descent)
205- descent = fstrs[i]->descent;
271+ f->descent = fstrs[i]->descent;
206272 }
207273
208274 if (num_missing_charset_list > 0)
@@ -213,89 +279,242 @@ get_font_set (const char *name, int *typep, int *ascentp, int *descentp)
213279 XFreeStringList (missing_charset_list);
214280 }
215281
216- *typep = FF_FONT_SET;
217- *ascentp = ascent;
218- *descentp = descent;
282+ return TRUE;
219283 }
220284
221- return font_set;
285+ return FALSE;
222286 }
223287
224-static void *
225-get_font_struct (const char *name, int *typep, int *ascentp, int *descentp)
288+static void
289+fontset_finalize (Lisp_Font *f)
226290 {
227- XFontStruct *font_struct;
291+ XFreeFontSet (dpy, f->font);
292+}
228293
229- font_struct = XLoadQueryFont (dpy, name);
294+static int
295+fontset_measure (Lisp_Font *f, u_char *string, size_t length)
296+{
297+ return XmbTextEscapement (f->font, string, length);
298+}
230299
231- if (font_struct != 0)
232- {
233- *typep = FF_FONT_STRUCT;
234- *ascentp = font_struct->ascent;
235- *descentp = font_struct->descent;
236- }
300+static void
301+fontset_draw (Lisp_Font *f, u_char *string, size_t length,
302+ Window id, GC gc, Lisp_Color *fg, int x, int y)
303+{
304+ XGCValues gcv;
305+
306+ gcv.foreground = fg->pixel;
307+ XChangeGC (dpy, gc, GCForeground, &gcv);
237308
238- return font_struct;
309+ XmbDrawString (dpy, id, f->font, gc, x, y, string, length);
239310 }
240311
312+static const Lisp_Font_Class fontset_class = {
313+ "xlfd",
314+ fontset_load, fontset_finalize,
315+ fontset_measure, fontset_draw,
316+};
317+
241318
319+/* Xft fonts */
242320
243-DEFUN("get-font", Fget_font, Sget_font, (repv name), rep_Subr1) /*
244-::doc:sawfish.wm.fonts#get-font::
245-get-font NAME
321+#ifdef HAVE_X11_XFT_XFT_H
246322
247-Return the font object representing the font named NAME (a standard X
248-font specifier string).
323+static bool
324+xft_load (Lisp_Font *f)
325+{
326+ XftFont *xft_font;
327+
328+ xft_font = XftFontOpenName (dpy, screen_num, rep_STR (f->name));
329+
330+ if (xft_font == 0)
331+ return FALSE;
332+
333+ f->font = xft_font;
334+ f->ascent = xft_font->ascent;
335+ f->descent = xft_font->descent;
336+
337+ return TRUE;
338+}
339+
340+static void
341+xft_finalize (Lisp_Font *f)
342+{
343+ XftFontClose (dpy, f->font);
344+}
345+
346+static int
347+xft_measure (Lisp_Font *f, u_char *string, size_t length)
348+{
349+ XGlyphInfo info;
350+
351+ XftTextExtents8 (dpy, f->font, string, length, &info);
352+
353+ return info.xOff;
354+}
355+
356+static void
357+xft_draw (Lisp_Font *f, u_char *string, size_t length,
358+ Window id, GC gc, Lisp_Color *fg, int x, int y)
359+{
360+ static XftDraw *draw;
361+
362+ XftColor xft_color;
363+
364+ if (draw == 0)
365+ draw = XftDrawCreate (dpy, id, image_visual, image_cmap);
366+ else
367+ XftDrawChange (draw, id);
368+
369+ xft_color.pixel = fg->pixel;
370+ xft_color.color.red = fg->red;
371+ xft_color.color.green = fg->green;
372+ xft_color.color.blue = fg->blue;
373+ xft_color.color.alpha = 65535; /* FIXME: */
374+
375+ XftDrawString8 (draw, &xft_color, f->font,
376+ x, y, string, length);
377+}
378+
379+static const Lisp_Font_Class xft_class = {
380+ "Xft",
381+ xft_load, xft_finalize,
382+ xft_measure, xft_draw,
383+};
384+
385+#endif /* HAVE_X11_XFT_XFT_H */
386+
387+
388+/* All classes */
389+
390+static const Lisp_Font_Class *classes[] = {
391+ &fontstruct_class,
392+ &fontset_class,
393+#ifdef HAVE_X11_XFT_XFT_H
394+ &xft_class,
395+#endif
396+ 0,
397+};
398+
399+
400+/* Entry points */
401+
402+DEFUN ("font-type-exists-p", Ffont_type_exists_p,
403+ Sfont_type_exists_p, (repv type), rep_Subr1) /*
404+::doc:sawfish.wm.fonts#font-type-exists-p::
405+font-type-exists-p TYPE
406+
407+Returns true if fonts with the type described by the string TYPE can be
408+loaded.
409+::end:: */
410+{
411+ int i;
412+
413+ rep_DECLARE1 (type, rep_STRINGP);
414+
415+ for (i = 0; classes[i] != 0; i++)
416+ {
417+ if (strcasecmp (rep_STR (type), classes[i]->type) == 0)
418+ return Qt;
419+ }
420+
421+ return Qnil;
422+}
423+
424+DEFUN("get-font-typed", Fget_font_typed, Sget_font_typed,
425+ (repv type, repv name), rep_Subr2) /*
426+::doc:sawfish.wm.fonts#get-font-typed::
427+get-font-typed TYPE NAME
428+
429+Return the font object representing the font named NAME. NAME is
430+interpreted based on the value of the string TYPE.
249431 ::end:: */
250432 {
251433 Lisp_Font *f;
434+ const Lisp_Font_Class *class;
435+ repv tem;
436+ int i;
437+
252438 rep_DECLARE1(name, rep_STRINGP);
439+ rep_DECLARE2(type, rep_STRINGP);
253440
254441 if (dpy == 0)
255442 return Qnil;
256443
257- f = font_list;
258- while (f != 0 && strcmp (rep_STR(name), rep_STR(f->name)) != 0)
259- f = f->next;
260-
261- if (f == 0)
444+ for (f = font_list; f != NULL; f = f->next)
262445 {
263- repv tem = global_symbol_value (Qfonts_are_fontsets);
264-
265- void *font = 0;
266- int type = -1;
267- int ascent, descent;
268-
269- if (font == 0 && tem != Qnil)
446+ if (strcmp (rep_STR(name), rep_STR(f->name)) == 0
447+ && strcmp (rep_STR (type), rep_STR (f->name)) == 0)
270448 {
271- font = get_font_set (rep_STR(name), &type, &ascent, &descent);
449+ return rep_VAL (f);
272450 }
451+ }
273452
274- if (font == 0)
275- {
276- font = get_font_struct (rep_STR(name), &type, &ascent, &descent);
277- }
453+ class = 0;
278454
279- if (font == 0)
455+ if (strcasecmp (rep_STR (type), "xlfd") == 0)
456+ {
457+ /* Boring old X core fonts */
458+
459+ tem = global_symbol_value (Qfonts_are_fontsets);
460+ if (tem != Qnil)
461+ class = &fontset_class;
462+ else
463+ class = &fontstruct_class;
464+ }
465+ else
466+ {
467+ for (i = 0; classes[i] != 0; i++)
280468 {
281- return Fsignal (Qerror, rep_list_2 (rep_string_dup ("no such font"), name));
469+ if (strcasecmp (rep_STR (type), classes[i]->type) == 0)
470+ {
471+ class = classes[i];
472+ break;
473+ }
282474 }
475+ }
283476
284- f = rep_ALLOC_CELL(sizeof(Lisp_Font));
285- rep_data_after_gc += sizeof (Lisp_Font);
477+ if (class == 0)
478+ {
479+ DEFSTRING (err, "unknown font type");
480+ return Fsignal (Qerror, rep_list_2 (rep_VAL (&err), type));
481+ }
482+
483+ f = rep_ALLOC_CELL(sizeof(Lisp_Font));
286484
287- f->next = font_list;
288- font_list = f;
485+ f->car = font_type;
486+ f->class = class;
487+ f->type = type;
488+ f->name = name;
489+ f->plist = Qnil;
289490
290- f->car = font_type | type;
291- f->name = name;
292- f->font = font;
293- f->plist = Qnil;
294- f->ascent = ascent;
295- f->descent = descent;
491+ if (!(*class->load) (f))
492+ {
493+ DEFSTRING (err, "unknown font");
494+
495+ rep_FREE_CELL (f);
496+ return Fsignal (Qerror, rep_list_2 (rep_VAL (&err), name));
296497 }
297498
298- return rep_VAL(f);
499+ rep_data_after_gc += sizeof (Lisp_Font);
500+
501+ f->next = font_list;
502+ font_list = f;
503+
504+ return rep_VAL (f);
505+}
506+
507+DEFUN("get-font", Fget_font, Sget_font, (repv name), rep_Subr1) /*
508+::doc:sawfish.wm.fonts#get-font::
509+get-font NAME
510+
511+Return the font object representing the font named NAME (a standard X
512+font specifier string).
513+::end:: */
514+{
515+ DEFSTRING (type, "xlfd");
516+
517+ return Fget_font_typed (rep_VAL (&type), name);
299518 }
300519
301520 DEFUN("font-get", Ffont_get, Sfont_get, (repv win, repv prop), rep_Subr2) /*
@@ -348,6 +567,17 @@ Set the property PROPERTY (a symbol) associated with FONT to VALUE.
348567 return val;
349568 }
350569
570+DEFUN("font-type", Ffont_type, Sfont_type, (repv font), rep_Subr1) /*
571+::doc:sawfish.wm.fonts#font-type::
572+font-type FONT
573+
574+Return the type of the font represented by the font object FONT.
575+::end:: */
576+{
577+ rep_DECLARE1(font, FONTP);
578+ return VFONT(font)->type;
579+}
580+
351581 DEFUN("font-name", Ffont_name, Sfont_name, (repv font), rep_Subr1) /*
352582 ::doc:sawfish.wm.fonts#font-name::
353583 font-name FONT
@@ -372,36 +602,16 @@ Return t if ARG is a font object.
372602 int
373603 x_text_width (repv font, u_char *string, size_t len)
374604 {
375- switch (FONT_TYPE (font))
376- {
377- case FF_FONT_STRUCT:
378- return XTextWidth (VFONT(font)->font, string, len);
379-
380- case FF_FONT_SET:
381- return XmbTextEscapement (VFONT(font)->font, string, len);
382-
383- default:
384- return 0;
385- }
605+ return (*VFONT (font)->class->measure) (VFONT (font), string, len);
386606 }
387607
608+/* The foreground pixel of GC is undefined after this function returns. */
388609 void
389-x_draw_string (Window id, repv font, GC gc,
610+x_draw_string (Window id, repv font, GC gc, Lisp_Color *fg_color,
390611 int x, int y, u_char *string, size_t len)
391612 {
392- switch (FONT_TYPE (font))
393- {
394- case FF_FONT_STRUCT: {
395- XFontStruct *fs = VFONT(font)->font;
396-
397- XSetFont (dpy, gc, fs->fid);
398- XDrawString (dpy, id, gc, x, y, string, len);
399- break; }
400-
401- case FF_FONT_SET:
402- XmbDrawString (dpy, id, VFONT(font)->font, gc, x, y, string, len);
403- break;
404- }
613+ return (*VFONT (font)->class->draw) (VFONT (font), string, len,
614+ id, gc, fg_color, x, y);
405615 }
406616
407617 DEFUN("text-width", Ftext_width, Stext_width, (repv string, repv font), rep_Subr2) /*
@@ -475,13 +685,15 @@ static void
475685 font_prin (repv stream, repv obj)
476686 {
477687 char buf[256];
478- sprintf (buf, "#<font %s>", rep_STR(VFONT(obj)->name));
688+ sprintf (buf, "#<font %s:%s>",
689+ rep_STR(VFONT(obj)->type), rep_STR(VFONT(obj)->name));
479690 rep_stream_puts (stream, buf, -1, FALSE);
480691 }
481692
482693 static void
483694 font_mark (repv obj)
484695 {
696+ rep_MARKVAL(VFONT(obj)->type);
485697 rep_MARKVAL(VFONT(obj)->name);
486698 rep_MARKVAL(VFONT(obj)->plist);
487699 }
@@ -494,18 +706,10 @@ font_sweep (void)
494706 while (w != 0)
495707 {
496708 Lisp_Font *next = w->next;
709+
497710 if (!rep_GC_CELL_MARKEDP(rep_VAL(w)))
498711 {
499- switch (FONT_TYPE (rep_VAL (w)))
500- {
501- case FF_FONT_STRUCT:
502- XFreeFont (dpy, w->font);
503- break;
504-
505- case FF_FONT_SET:
506- XFreeFontSet (dpy, w->font);
507- break;
508- }
712+ (*w->class->finalize) (w);
509713 rep_FREE_CELL(w);
510714 }
511715 else
@@ -528,9 +732,13 @@ fonts_init (void)
528732 font_type = rep_register_new_type ("font", font_cmp, font_prin, font_prin,
529733 font_sweep, font_mark,
530734 0, 0, 0, 0, 0, 0, 0);
735+
736+ rep_ADD_SUBR(Sfont_type_exists_p);
737+ rep_ADD_SUBR(Sget_font_typed);
531738 rep_ADD_SUBR(Sget_font);
532739 rep_ADD_SUBR(Sfont_get);
533740 rep_ADD_SUBR(Sfont_put);
741+ rep_ADD_SUBR(Sfont_type);
534742 rep_ADD_SUBR(Sfont_name);
535743 rep_ADD_SUBR(Sfontp);
536744 rep_ADD_SUBR(Stext_width);
@@ -541,10 +749,13 @@ fonts_init (void)
541749 rep_INTERN_SPECIAL(default_font);
542750 if (!batch_mode_p ())
543751 {
544- repv font = Fget_font (rep_string_dup("fixed"));
752+ DEFSTRING (type, "xlfd");
753+ DEFSTRING (name, "fixed");
754+
755+ repv font = Fget_font_typed (rep_VAL (&type), rep_VAL (&name));
545756 if (font == rep_NULL || !FONTP(font))
546757 {
547- fputs ("can't load fixed font during initialisation", stderr);
758+ fputs ("can't load 'fixed' font during initialisation", stderr);
548759 rep_throw_value = rep_NULL;
549760 font = Qnil;
550761 }
--- a/src/frames.c
+++ b/src/frames.c
@@ -658,8 +658,6 @@ set_frame_part_fg (struct frame_part *fp)
658658 {
659659 int state = current_state (fp);
660660 repv font = fp->font[state], fg = fp->fg[state];
661- XGCValues gcv;
662- u_long gcv_mask = 0;
663661 repv string = rep_NULL;
664662 int length = 0, width, height, x, y;
665663 Lisp_Window *win = fp->win;
@@ -743,6 +741,8 @@ set_frame_part_fg (struct frame_part *fp)
743741
744742 if (IMAGEP(fg))
745743 {
744+ XGCValues gcv;
745+ u_long gcv_mask = 0;
746746 Pixmap fg_pixmap, fg_mask;
747747
748748 if (fp->drawn.fg == fg
@@ -816,14 +816,8 @@ set_frame_part_fg (struct frame_part *fp)
816816 set_frame_part_bg (fp);
817817 }
818818
819- if (COLORP(fg))
820- {
821- gcv.foreground = VCOLOR(fg)->pixel;
822- gcv_mask |= GCForeground;
823- }
824-
825- XChangeGC (dpy, fp->gc, gcv_mask, &gcv);
826- x_draw_string (fp->id, font, fp->gc, x, y + VFONT(font)->ascent,
819+ x_draw_string (fp->id, font, fp->gc, VCOLOR(fg),
820+ x, y + VFONT(font)->ascent,
827821 rep_STR(string), length);
828822
829823 fp->drawn.text = string;
--- a/src/functions.c
+++ b/src/functions.c
@@ -1041,10 +1041,9 @@ refresh_message_window ()
10411041 char *ptr;
10421042 int row = 0;
10431043
1044- values.foreground = VCOLOR(message.fg)->pixel;
10451044 values.background = VCOLOR(message.bg)->pixel;
10461045 values.graphics_exposures = False;
1047- mask = GCForeground | GCBackground | GCGraphicsExposures;
1046+ mask = GCBackground | GCGraphicsExposures;
10481047
10491048 if (message.gc == 0)
10501049 message.gc = XCreateGC (dpy, message_win, mask, &values);
@@ -1071,7 +1070,7 @@ refresh_message_window ()
10711070 offset = (message.width - width) / 2;
10721071 }
10731072 x_draw_string (message_win, message.font,
1074- message.gc, offset,
1073+ message.gc, VCOLOR(message.fg), offset,
10751074 MSG_PAD_Y
10761075 + row * (VFONT(message.font)->ascent
10771076 + VFONT(message.font)->descent
--- a/src/sawmill.h
+++ b/src/sawmill.h
@@ -1,5 +1,5 @@
11 /* sawmill.h -- Main include file, brings in all the rest
2- $Id: sawmill.h,v 1.2 1999/07/25 15:02:21 john Exp
2+ $Id$
33
44 Copyright (C) 1999 John Harper <john@dcs.warwick.ac.uk>
55
@@ -168,10 +168,14 @@ typedef struct lisp_window {
168168 #define WINDOW_FOCUSED_P(w) (focus_window == w)
169169 #define WINDOW_IS_GONE_P(w) (w->id == 0)
170170
171+typedef struct Lisp_Font_Class_struct Lisp_Font_Class;
172+
171173 /* An allocated font */
172174 typedef struct lisp_font {
173175 repv car;
174176 struct lisp_font *next;
177+ const Lisp_Font_Class *class;
178+ repv type;
175179 repv name;
176180 void *font;
177181 repv plist;
@@ -181,14 +185,6 @@ typedef struct lisp_font {
181185 #define FONTP(v) rep_CELL16_TYPEP(v, font_type)
182186 #define VFONT(v) ((Lisp_Font *)rep_PTR(v))
183187
184-#define FF_FONT_SET (0 << (rep_CELL16_TYPE_BITS + 0))
185-#define FF_FONT_STRUCT (1 << (rep_CELL16_TYPE_BITS + 0))
186-#define FF_FONT_MASK (3 << (rep_CELL16_TYPE_BITS + 0))
187-
188-#define FONT_TYPE(v) (VFONT(v)->car & FF_FONT_MASK)
189-#define FONT_SET_P(v) (FONT_TYPE (v) == FF_FONT_SET)
190-#define FONT_STRUCT_P(v) (FONT_TYPE (v) == FF_FONT_STRUCT)
191-
192188 /* An allocated color */
193189 typedef struct lisp_color {
194190 repv car;
--- a/src/sawmill_subrs.h
+++ b/src/sawmill_subrs.h
@@ -108,7 +108,7 @@ extern void events_kill (void);
108108 extern int font_type;
109109 extern repv Qdefault_font;
110110 extern int x_text_width (repv font, u_char *string, size_t len);
111-extern void x_draw_string (Window id, repv font, GC gc,
111+extern void x_draw_string (Window id, repv font, GC gc, Lisp_Color *fg_color,
112112 int x, int y, u_char *string, size_t len);
113113 extern repv Fget_font(repv name);
114114 extern repv Ffont_get(repv font, repv prop);