summaryrefslogtreecommitdiff
path: root/pango/pangocairo-font.c
diff options
context:
space:
mode:
Diffstat (limited to 'pango/pangocairo-font.c')
-rw-r--r--pango/pangocairo-font.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c
index 68130e28..d779b983 100644
--- a/pango/pangocairo-font.c
+++ b/pango/pangocairo-font.c
@@ -280,9 +280,13 @@ _pango_cairo_font_get_hex_box_info (PangoCairoFont *cfont)
hbi->box_height = 3 * hbi->pad_y + rows * (hbi->pad_y + hbi->digit_height);
- if (rows == 1)
+ if (rows == 1 || hbi->box_height <= font_extents.ascent)
{
- hbi->box_descent = hbi->pad_y;
+ hbi->box_descent = 2 * hbi->pad_y;
+ }
+ else if (hbi->box_height <= font_extents.ascent + font_extents.descent - 2 * hbi->pad_y)
+ {
+ hbi->box_descent = 2 * hbi->pad_y + hbi->box_height - font_extents.ascent;
}
else
{