aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2015-06-01 17:46:20 +0300
committerEli Zaretskii2015-06-01 17:46:20 +0300
commit957cbfd7650e6ebd1afc62daeb5f6923730112c9 (patch)
treefc0beeea9a8b8759cc4974b960458af0a3b011ff /src
parentcab645a62f3e5963ee7da94eb9c33961601c6651 (diff)
downloademacs-957cbfd7650e6ebd1afc62daeb5f6923730112c9.tar.gz
emacs-957cbfd7650e6ebd1afc62daeb5f6923730112c9.zip
NS equivalents of xterm.c and w32term.c changes
* src/nsterm.m (ns_maybe_dumpglyphs_background): Force redraw of glyph string background also when the font in use claims preposterously large global height value. Helps to remove artifacts left from previous displays when glyphless characters are displayed as hex code in a box. (x_new_font): Call get_font_ascent_descent to obtain a reasonable value for FRAME_LINE_HEIGHT, even when a font claims very large value for its height.
Diffstat (limited to 'src')
-rw-r--r--src/nsterm.m9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index 67a03898d13..2806f31155d 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -2928,6 +2928,11 @@ ns_maybe_dumpglyphs_background (struct glyph_string *s, char force_p)
2928 { 2928 {
2929 int box_line_width = max (s->face->box_line_width, 0); 2929 int box_line_width = max (s->face->box_line_width, 0);
2930 if (FONT_HEIGHT (s->font) < s->height - 2 * box_line_width 2930 if (FONT_HEIGHT (s->font) < s->height - 2 * box_line_width
2931 /* When xdisp.c ignores FONT_HEIGHT, we cannot trust font
2932 dimensions, since the actual glyphs might be much
2933 smaller. So in that case we always clear the rectangle
2934 with background color. */
2935 || FONT_TOO_HIGH (s->font)
2931 || s->font_not_found_p || s->extends_to_end_of_line_p || force_p) 2936 || s->font_not_found_p || s->extends_to_end_of_line_p || force_p)
2932 { 2937 {
2933 struct face *face; 2938 struct face *face;
@@ -7687,6 +7692,7 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
7687{ 7692{
7688 struct font *font = XFONT_OBJECT (font_object); 7693 struct font *font = XFONT_OBJECT (font_object);
7689 EmacsView *view = FRAME_NS_VIEW (f); 7694 EmacsView *view = FRAME_NS_VIEW (f);
7695 int font_ascent, font_descent;
7690 7696
7691 if (fontset < 0) 7697 if (fontset < 0)
7692 fontset = fontset_from_font (font_object); 7698 fontset = fontset_from_font (font_object);
@@ -7701,7 +7707,8 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
7701 7707
7702 FRAME_BASELINE_OFFSET (f) = font->baseline_offset; 7708 FRAME_BASELINE_OFFSET (f) = font->baseline_offset;
7703 FRAME_COLUMN_WIDTH (f) = font->average_width; 7709 FRAME_COLUMN_WIDTH (f) = font->average_width;
7704 FRAME_LINE_HEIGHT (f) = font->height; 7710 get_font_ascent_descent (font, &font_ascent, &font_descent);
7711 FRAME_LINE_HEIGHT (f) = font_ascent + font_descent;
7705 7712
7706 /* Compute the scroll bar width in character columns. */ 7713 /* Compute the scroll bar width in character columns. */
7707 if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0) 7714 if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0)