From a66d76d290e022285e7772b1286f45ddbc3ef23e Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Fri, 27 Oct 2000 01:22:21 +0000 Subject: [PATCH] (x_draw_glyph_string): Add a workaround so that fonts that specify a negative underline position can still use underlines. --- src/xterm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) -- 2.39.2