(realize_default_face): If the font chosen for the
authorKenichi Handa <handa@m17n.org>
Wed, 10 May 2006 12:38:58 +0000 (12:38 +0000)
committerKenichi Handa <handa@m17n.org>
Wed, 10 May 2006 12:38:58 +0000 (12:38 +0000)
default face was different from the frame font, adjust the frame
font.

src/ChangeLog
src/xfaces.c

index dff5c16..afaa1c3 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-10  Kenichi Handa  <handa@m17n.org>
+
+       * xfaces.c (realize_default_face) [HAVE_X_WINDOWS]: If the font
+       chosen for the default face was different from the frame font,
+       adjust the frame font.
+
 2006-05-10  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * image.c (Qduration) [MAC_OS]: Undo previous change.
index a0bb97f..a5c5a21 100644 (file)
@@ -7072,6 +7072,16 @@ realize_default_face (f)
   check_lface (lface);
   bcopy (XVECTOR (lface)->contents, attrs, sizeof attrs);
   face = realize_face (c, attrs, 0, NULL, DEFAULT_FACE_ID);
+
+#ifdef HAVE_WINDOW_SYSTEM
+#ifdef HAVE_X_WINDOWS  
+  if (face->font != FRAME_FONT (f))
+    /* As the font specified for the frame was not acceptable as a
+       font for the default face (perhaps because auto-scaled fonts
+       are rejected), we must adjust the frame font.  */
+    x_set_font (f, build_string (face->font_name), Qnil);
+#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
   return 1;
 }