changeset 2785:55e9c556bbf8

* xterm.c (dumpglyphs): Give the cursor higher priority than the face specified by the glyph under it. * xterm.c (dumpglyphs): Move the underline up a row. I dislike the way X addresses pixels. Quickdraw is much nicer. * xterm.c (dumpglyphs): Pass the proper arguments to intern_face. * xterm.c (dumpglyphs): Don't increment left twice.
author Jim Blandy <jimb@redhat.com>
date Fri, 14 May 1993 14:44:26 +0000
parents f8c6796b7777
children 286057aa81c7
files src/xterm.c
diffstat 1 files changed, 15 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Fri May 14 14:44:01 1993 +0000
+++ b/src/xterm.c	Fri May 14 14:44:26 1993 +0000
@@ -457,7 +457,14 @@
 	FONT_TYPE *font = FACE_FONT (face);
 	GC gc = FACE_GC (face);
 
-	if (cf != 0)
+	/* Cursor display take full precidence.  */
+	if (hl == 2)
+	  {
+	    gc   = (f->display.x->cursor_gc);
+	  }
+
+	/* Then comes faces of the text itself.  */
+	else if (cf != 0)
 	  {
 	    /* The face codes on the glyphs must be valid indices into the
 	       frame's face table.  */
@@ -467,10 +474,12 @@
 	    if (cf == 1)
 	      face = FRAME_MODE_LINE_FACE (f);
 	    else
-	      face = intern_face (FRAME_FACES (f) [cf]);
+	      face = intern_face (f, FRAME_FACES (f) [cf]);
 	    font = FACE_FONT (face);
 	    gc = FACE_GC (face);
 	  }
+
+	/* Then comes the distinction between modeline and normal text.  */
 	else if (hl == 0)
 	  ;
 	else if (hl == 1)
@@ -479,23 +488,18 @@
 	    font = FACE_FONT (face);
 	    gc   = FACE_GC   (face);
 	  }
-	else if (hl == 2)
-	  {
-	    gc   = (f->display.x->cursor_gc);
-	  }
 
 	XDrawImageString (x_current_display, window, gc,
 			  left, top + FONT_BASE (font), buf, len);
-	left += len * FONT_WIDTH (font);
 
 	/* We should probably check for XA_UNDERLINE_POSITION and
 	   XA_UNDERLINE_THICKNESS properties on the font, but let's
 	   just get the thing working, and come back to that.  */
 	{
-	  int underline_position = 2;
-
-	  if (font->descent < underline_position)
-	    underline_position = font->descent;
+	  int underline_position = 1;
+
+	  if (font->descent <= underline_position)
+	    underline_position = font->descent - 1;
 
 	  if (face->underline)
 	    XFillRectangle (x_current_display, FRAME_X_WINDOW (f),