From: Miles Bader Date: Fri, 27 Oct 2000 01:22:21 +0000 (+0000) Subject: (x_draw_glyph_string): Add a workaround so that fonts that specify a X-Git-Tag: emacs-pretest-21.0.90~526 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a66d76d290e022285e7772b1286f45ddbc3ef23e;p=emacs.git (x_draw_glyph_string): Add a workaround so that fonts that specify a negative underline position can still use underlines. --- diff --git a/src/xterm.c b/src/xterm.c index 9e1cabe8c3c..3539d8123af 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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)