aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32term.c
diff options
context:
space:
mode:
authorEli Zaretskii2015-05-26 18:29:40 +0300
committerEli Zaretskii2015-05-26 18:29:40 +0300
commit53bedd3a8eb7169b734ee8925c76712c68d9c4fc (patch)
treea36ee973a6163d8281ebf00ba21e01d1b064b8d5 /src/w32term.c
parent45c92ddd99f5d3ceb520f9a27678bbedde83589b (diff)
downloademacs-53bedd3a8eb7169b734ee8925c76712c68d9c4fc.tar.gz
emacs-53bedd3a8eb7169b734ee8925c76712c68d9c4fc.zip
Teach MS-Windows font back-end return per-glyph ascent/descent
* src/w32font.h (struct w32_metric_cache): Add ascent and descent values. * src/w32font.c (w32font_text_extents): Compute, cache, and accumulate per-glyph ascent and descent values, instead of copying global values from the font. If the values are not available from the font data, i.e., non-TTF fonts, fall back on font-global values. (compute_metrics): Compute and return per-glyph ascent and descent values, if returned by GetGlyphOutlineW, falling back on font-global values. (Bug#20628) * src/w32term.c (w32_draw_rectangle): Add 1 pixel to width and height of rectangle to be drawn, to be compatible with XDrawRectangle. Fixes glyphless-char display as hex codes in a box, when per-glyph ascent/descent values are used.
Diffstat (limited to 'src/w32term.c')
-rw-r--r--src/w32term.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 089c43c8a26..0bc2e980214 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -401,7 +401,13 @@ w32_draw_rectangle (HDC hdc, XGCValues *gc, int x, int y,
401 oldhb = SelectObject (hdc, hb); 401 oldhb = SelectObject (hdc, hb);
402 oldhp = SelectObject (hdc, hp); 402 oldhp = SelectObject (hdc, hp);
403 403
404 Rectangle (hdc, x, y, x + width, y + height); 404 /* We enlarge WIDTH and HEIGHT by 1 to be bug-compatible to the
405 brain-dead design of XDrawRectangle, which draws a rectangle that
406 is 1 pixel wider and higher than its arguments WIDTH and HEIGHT.
407 This allows us to keep the code that calls this function similar
408 to the corresponding code in xterm.c. For the details, see
409 http://lists.gnu.org/archives/html/emacs-devel/2014-10/msg00546.html. */
410 Rectangle (hdc, x, y, x + width + 1, y + height + 1);
405 411
406 SelectObject (hdc, oldhb); 412 SelectObject (hdc, oldhb);
407 SelectObject (hdc, oldhp); 413 SelectObject (hdc, oldhp);