(font_find_for_lface): Reflect LFACE_FONT in the font
authorKenichi Handa <handa@m17n.org>
Thu, 15 May 2008 10:29:39 +0000 (10:29 +0000)
committerKenichi Handa <handa@m17n.org>
Thu, 15 May 2008 10:29:39 +0000 (10:29 +0000)
preference.

src/ChangeLog
src/font.c

index 25626fb..089afb9 100644 (file)
@@ -1,3 +1,8 @@
+2008-05-15  Kenichi Handa  <handa@m17n.org>
+
+       * font.c (font_find_for_lface): Reflect LFACE_FONT in the font
+       preference.
+
 2008-05-15  Glenn Morris  <rgm@gnu.org>
 
        * emacs.c (USAGE1, standard_args): Remove -disable-font-backend.
index 107426e..653db01 100644 (file)
@@ -2780,6 +2780,14 @@ font_find_for_lface (f, attrs, spec, c)
       double pt;
       for (i = 0; i < FONT_EXTRA_INDEX; i++)
        ASET (prefer, i, AREF (spec, i));
+      if (FONTP (attrs[LFACE_FONT_INDEX]))
+       {
+         Lisp_Object face_font = attrs[LFACE_FONT_INDEX];
+
+         for (i = 0; i < FONT_EXTRA_INDEX; i++)
+           if (NILP (AREF (prefer, i)))
+             ASET (prefer, i, AREF (face_font, i));
+       }
       if (NILP (AREF (prefer, FONT_FAMILY_INDEX)))
        font_parse_family_registry (attrs[LFACE_FAMILY_INDEX], Qnil, prefer);
       if (NILP (AREF (prefer, FONT_WEIGHT_INDEX)))