changeset 91171:609500aa30a8

Include "font.h" unconditionally. (choose_face_font): Accept new form of font-spec.
author Kenichi Handa <handa@m17n.org>
date Mon, 03 Dec 2007 13:53:55 +0000
parents f659645b3f44
children 32461c53ccb4
files src/xfaces.c
diffstat 1 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfaces.c	Mon Dec 03 13:52:35 2007 +0000
+++ b/src/xfaces.c	Mon Dec 03 13:53:55 2007 +0000
@@ -250,9 +250,7 @@
 #include "termchar.h"
 
 #ifdef HAVE_WINDOW_SYSTEM
-#ifdef USE_FONT_BACKEND
 #include "font.h"
-#endif	/* USE_FONT_BACKEND */
 #endif	/* HAVE_WINDOW_SYSTEM */
 
 #ifdef HAVE_X_WINDOWS
@@ -7277,9 +7275,8 @@
    (if specified).
 
    When we are choosing a font for ASCII characters, FONT-SPEC is
-   always nil.  Otherwise FONT-SPEC is a list
-	[ FAMILY WEIGHT SLANT SWIDTH ADSTYLE REGISTRY ]
-   or a string specifying a font name pattern.
+   always nil.  Otherwise FONT-SPEC is an object created by
+   `font-spec' or a string specifying a font name pattern.
 
    If NEEDS_OVERSTRIKE is not NULL, a boolean is returned in it to
    indicate whether the resulting font should be drawn using
@@ -7318,10 +7315,12 @@
   if (VECTORP (font_spec))
     {
       pattern = Qnil;
-      if (STRINGP (AREF (font_spec, FONT_SPEC_FAMILY_INDEX)))
-	family = Fcons (AREF (font_spec, FONT_SPEC_FAMILY_INDEX), family);
-      adstyle = AREF (font_spec, FONT_SPEC_ADSTYLE_INDEX);
-      registry = Fcons (AREF (font_spec, FONT_SPEC_REGISTRY_INDEX), Qnil);
+      if (! NILP (AREF (font_spec, FONT_FAMILY_INDEX)))
+	family = Fcons (SYMBOL_NAME (AREF (font_spec, FONT_FAMILY_INDEX)),
+			family);
+      adstyle = AREF (font_spec, FONT_ADSTYLE_INDEX);
+      registry = Fcons (SYMBOL_NAME (AREF (font_spec, FONT_REGISTRY_INDEX)),
+			Qnil);
     }
   else if (STRINGP (font_spec))
     {