changeset 32938:4b9c0e6751e7

(x_draw_glyph_string): Add a workaround so that fonts that specify a negative underline position can still use underlines.
author Miles Bader <miles@gnu.org>
date Fri, 27 Oct 2000 01:22:21 +0000
parents dc58e218a878
children c8119677d63e
files src/xterm.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Fri Oct 27 01:16:47 2000 +0000
+++ b/src/xterm.c	Fri Oct 27 01:22:21 2000 +0000
@@ -4221,7 +4221,12 @@
 
 	  if (!XGetFontProperty (s->font, XA_UNDERLINE_THICKNESS, &h))
 	    h = 1;
-	  if (!XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &dy))
+	  if (!XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &dy)
+	      /* If the font specifies a negative underline position,
+		 we'll get a huge positive number, because dy is
+		 unsigned.  This comparison is a workaround that just
+		 ignores the font's underline position in that case.  XXX */
+	      || dy > s->height)
 	    dy = s->height - h;
       
 	  if (s->face->underline_defaulted_p)