diff options
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2019-05-14 10:17:16 +0900 |
---|---|---|
committer | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2019-05-14 10:17:16 +0900 |
commit | 9b28a5083edecacfac3c7e16308bd8af3f4773a2 (patch) | |
tree | c01c23b892c62d944d89e1f281cbeb7b307d3562 /src/ftcrfont.c | |
parent | 2f7e97ef482ddacd0ed21ccd25ca777beb60ab35 (diff) | |
download | emacs-9b28a5083edecacfac3c7e16308bd8af3f4773a2.tar.gz |
Avoid artifacts in ftx and ftcr font backend drivers
* src/ftcrfont.c (ftcrfont_open):
* src/ftfont.c (ftfont_open2): Make font->height equal to sum of font->ascent
and font->descent. Respect :minspace property.
(ftfont_open2): Remove redundant assignment.
(syms_of_ftfont) <QCminspace>: New DEFSYM.
Diffstat (limited to 'src/ftcrfont.c')
-rw-r--r-- | src/ftcrfont.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ftcrfont.c b/src/ftcrfont.c index 8a1c9a48e1f..e7c73eac4d3 100644 --- a/src/ftcrfont.c +++ b/src/ftcrfont.c @@ -160,8 +160,18 @@ ftcrfont_open (struct frame *f, Lisp_Object entity, int pixel_size) cairo_font_extents_t extents; cairo_scaled_font_extents (ftcrfont_info->cr_scaled_font, &extents); font->ascent = lround (extents.ascent); - font->descent = lround (extents.descent); - font->height = lround (extents.height); + Lisp_Object val = assq_no_quit (QCminspace, + AREF (entity, FONT_EXTRA_INDEX)); + if (!(CONSP (val) && NILP (XCDR (val)))) + { + font->descent = lround (extents.descent); + font->height = font->ascent + font->descent; + } + else + { + font->height = lround (extents.height); + font->descent = font->height - font->ascent; + } cairo_glyph_t stack_glyph; int n = 0; |