summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2006-11-21 17:22:49 +0000
committerChong Yidong <cyd@stupidchicken.com>2006-11-21 17:22:49 +0000
commit73158a393abb74e3bc9efca7c50ba220f8720c91 (patch)
treef1738758328ac9abbfae7641183e55246fb57db1 /src
parentd166ca6de5d41f5e9a57f5111a53bcb811064966 (diff)
downloademacs-73158a393abb74e3bc9efca7c50ba220f8720c91.tar.gz
(realize_default_face): Check if the default font name
exists on this display before trying to use it.
Diffstat (limited to 'src')
-rw-r--r--src/xfaces.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/xfaces.c b/src/xfaces.c
index bd08871f278..e93531e1f59 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -7071,10 +7071,18 @@ realize_default_face (f)
#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;