changeset 28443:17fb2089c222

(x_produce_glyphs): When displaying unibyte text or ASCII, handle case that per-char metric is NULL.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 31 Mar 2000 11:52:58 +0000
parents efd5a62ccce9
children 5fd694968d4c
files src/xterm.c
diffstat 1 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Fri Mar 31 11:29:51 2000 +0000
+++ b/src/xterm.c	Fri Mar 31 11:52:58 2000 +0000
@@ -1823,9 +1823,20 @@
 	  pcm = x_per_char_metric (font, &char2b);
 	  it->ascent = font->ascent + boff;
 	  it->descent = font->descent - boff;
-	  it->phys_ascent = pcm->ascent + boff;
-	  it->phys_descent = pcm->descent - boff;
-	  it->pixel_width = pcm->width;
+
+	  if (pcm)
+	    {
+	      it->phys_ascent = pcm->ascent + boff;
+	      it->phys_descent = pcm->descent - boff;
+	      it->pixel_width = pcm->width;
+	    }
+	  else
+	    {
+	      it->glyph_not_available_p = 1;
+	      it->phys_ascent = font->ascent + boff;
+	      it->phys_descent = font->descent - boff;
+	      it->pixel_width = FONT_WIDTH (font);
+	    }
 
 	  /* If this is a space inside a region of text with
 	     `space-width' property, change its width.  */