]> git.eshelyaron.com Git - emacs.git/commitdiff
(x_draw_glyph_string): Add a workaround so that fonts that specify a
authorMiles Bader <miles@gnu.org>
Fri, 27 Oct 2000 01:22:21 +0000 (01:22 +0000)
committerMiles Bader <miles@gnu.org>
Fri, 27 Oct 2000 01:22:21 +0000 (01:22 +0000)
  negative underline position can still use underlines.

src/xterm.c

index 9e1cabe8c3c9163a13c254ccd873dae5fb0bfbce..3539d8123af99e630ba5152445bde03045ab30f3 100644 (file)
@@ -4221,7 +4221,12 @@ x_draw_glyph_string (s)
 
          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)