changeset 22522:f56d8440c0a4

(dumpglyphs): Check the case that FACE_FONT (face) is NULL. While displaing cursor with non-default face, if the variable `font' is NULL, don't set GCFont.
author Kenichi Handa <handa@m17n.org>
date Sat, 20 Jun 1998 03:01:00 +0000
parents da62a50f7cff
children b02a5ea8cf93
files src/xterm.c
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Sat Jun 20 02:59:51 1998 +0000
+++ b/src/xterm.c	Sat Jun 20 03:01:00 1998 +0000
@@ -783,7 +783,7 @@
 	    if (charset == CHARSET_ASCII || charset == charset_latin_iso8859_1)
 	      {
 		font = FACE_FONT (face);
-		if (font == (XFontStruct *) FACE_DEFAULT)
+		if (!font || font == (XFontStruct *) FACE_DEFAULT)
 		  font = f->output_data.x->font;
 		baseline = FONT_BASE (f->output_data.x->font);
 		if (charset == charset_latin_iso8859_1)
@@ -837,12 +837,14 @@
 		    xgcv.background = face->foreground;
 		    xgcv.foreground = face->background;
 		  }
+		xgcv.graphics_exposures = 0;
+		mask = GCForeground | GCBackground | GCGraphicsExposures;
 		if (font)
-		  xgcv.font = font->fid;
-		else
-		  xgcv.font = FACE_FONT (face)->fid;
-		xgcv.graphics_exposures = 0;
-		mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures;
+		  {
+		    xgcv.font = font->fid;
+		    mask |= GCFont;
+		  }
+
 		if (FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc)
 		  XChangeGC (FRAME_X_DISPLAY (f),
 			     FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc,