if (FONT_OBJECT_P (font_object))
{
struct font *font = XFONT_OBJECT (font_object);
+ int font_ascent, font_descent;
- metrics->ascent = font->ascent;
- metrics->descent = font->descent;
+ get_font_ascent_descent (font, &font_ascent, &font_descent);
+ metrics->ascent = font_ascent;
+ metrics->descent = font_descent;
}
else
{
extern void produce_stretch_glyph (struct it *);
extern int merge_glyphless_glyph_face (struct it *);
+extern void get_font_ascent_descent (struct font *, int *, int *);
+
#ifdef HAVE_WINDOW_SYSTEM
#ifdef GLYPH_DEBUG
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
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;