]> code.delx.au - gnu-emacs/blobdiff - src/xdisp.c
Fix display of composite characters with large fonts
[gnu-emacs] / src / xdisp.c
index 50d7376b28a22b84afa1ac7639ee0faea51544e8..53303272e60a9d0106322c8440f40c19a1c67d93 100644 (file)
@@ -24079,6 +24079,17 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
   return false;
 }
 
+void
+get_font_ascent_descent (struct font *font, int *ascent, int *descent)
+{
+#ifdef HAVE_WINDOW_SYSTEM
+  normal_char_ascent_descent (font, -1, ascent, descent);
+#else
+  *ascent = 1;
+  *descent = 0;
+#endif
+}
+
 \f
 /***********************************************************************
                             Glyph Display
@@ -26818,9 +26829,10 @@ x_produce_glyphs (struct it *it)
          boff = font->baseline_offset;
          if (font->vertical_centering)
            boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff;
-         font_ascent = FONT_BASE (font) + boff;
-         font_descent = FONT_DESCENT (font) - boff;
-         font_height = FONT_HEIGHT (font);
+         normal_char_ascent_descent (font, -1, &font_ascent, &font_descent);
+         font_ascent +=  boff;
+         font_descent -= boff;
+         font_height = font_ascent + font_descent;
 
          cmp->font = font;