Mercurial > emacs
diff src/xfaces.c @ 74114:cd686b5380c4
(realize_default_face): Check if the default font name
exists on this display before trying to use it.
| author | Chong Yidong <cyd@stupidchicken.com> |
|---|---|
| date | Tue, 21 Nov 2006 17:22:49 +0000 |
| parents | ea7f3c26d52b |
| children | 3d45362f1d38 c71725faff1a f1d13e615070 |
line wrap: on
line diff
--- a/src/xfaces.c Tue Nov 21 16:11:30 2006 +0000 +++ b/src/xfaces.c Tue Nov 21 17:22:49 2006 +0000 @@ -7071,10 +7071,18 @@ #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); + { + /* This can happen when making a frame on a display that does + not support the default font. */ + if (!face->font) + return 0; + + /* Otherwise, the font specified for the frame was not + acceptable as a font for the default face (perhaps because + auto-scaled fonts are rejected), so 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;
