Mercurial > emacs
comparison src/xterm.c @ 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 | 3558c9628dc9 |
children | 1b418a786c41 |
comparison
equal
deleted
inserted
replaced
32937:dc58e218a878 | 32938:4b9c0e6751e7 |
---|---|
4219 { | 4219 { |
4220 unsigned long dy, h; | 4220 unsigned long dy, h; |
4221 | 4221 |
4222 if (!XGetFontProperty (s->font, XA_UNDERLINE_THICKNESS, &h)) | 4222 if (!XGetFontProperty (s->font, XA_UNDERLINE_THICKNESS, &h)) |
4223 h = 1; | 4223 h = 1; |
4224 if (!XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &dy)) | 4224 if (!XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &dy) |
4225 /* If the font specifies a negative underline position, | |
4226 we'll get a huge positive number, because dy is | |
4227 unsigned. This comparison is a workaround that just | |
4228 ignores the font's underline position in that case. XXX */ | |
4229 || dy > s->height) | |
4225 dy = s->height - h; | 4230 dy = s->height - h; |
4226 | 4231 |
4227 if (s->face->underline_defaulted_p) | 4232 if (s->face->underline_defaulted_p) |
4228 XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy, | 4233 XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy, |
4229 s->width, h); | 4234 s->width, h); |