]> code.delx.au - gnu-emacs/commitdiff
Fix display when a font claims large values of ascent and descent
authorEli Zaretskii <eliz@gnu.org>
Sat, 6 Jun 2015 12:55:15 +0000 (15:55 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 6 Jun 2015 13:10:19 +0000 (16:10 +0300)
This fixes bug#20628.

* src/xdisp.c (get_phys_cursor_geometry): Correct the Y
coordinate of a hollow cursor glyph when the original glyph's
ascent is too small.
(get_font_ascent_descent, normal_char_ascent_descent)
(normal_char_height): New functions.
(handle_single_display_spec, append_space_for_newline)
(calc_pixel_width_or_height, produce_stretch_glyph)
(calc_line_height_property): Use normal_char_ascent_descent and
normal_char_height.
(x_produce_glyphs): When font-global values of ascent and descent
are too large, use per-character glyph metrics instead, if
possible.  But don't allow the glyph row's ascent and descent
values become smaller than the values from the metrics of the
font's "normal" character.

* src/xftfont.c (xftfont_draw):
* src/w32font.c (w32font_draw): Correct the values of ascent and
descent used to draw glyphless characters' hex code in a box.

* src/xterm.c (x_draw_glyph_string_background):
* src/xdisp.c (x_produce_glyphs):
* src/w32term.c (x_draw_glyph_string_background):
* src/nsterm.m (ns_maybe_dumpglyphs_background): Use FONT_TOO_HIGH
to detect fonts whose global ascent and descent values are too
large to be used in layout decision, and redraw the background
when that happens.

* src/dispextern.h (FONT_TOO_HIGH): New macro.
(get_font_ascent_descent): Add prototype.

* src/xterm.c (x_new_font):
* src/w32term.c (x_new_font):
* src/nsterm.m (x_new_font):
* src/font.c (font_open_entity):
* src/composite.c (composition_gstring_width): Use
get_font_ascent_descent to obtain reasonable values for ascent and
descent of a font.

1  2 
src/composite.c
src/font.c
src/xdisp.c
src/xterm.c

diff --cc src/composite.c
Simple merge
diff --cc src/font.c
Simple merge
diff --cc src/xdisp.c
Simple merge
diff --cc src/xterm.c
Simple merge