summaryrefslogtreecommitdiff
path: root/pango/pangocairo-fcfont.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-08-16 02:01:17 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-08-16 02:01:17 +0000
commit927657a432fadf219e7fdf057e4493658192a963 (patch)
tree4ed60f3434529a69f7e7586def646437623a9486 /pango/pangocairo-fcfont.c
parent3b88b840eac1b8b8dca9c6d93f916ef70e973ca8 (diff)
downloadpango-927657a432fadf219e7fdf057e4493658192a963.tar.gz
Return if none of logical_rect or ink_rect is non-NULL.
2006-08-15 Behdad Esfahbod <behdad@gnome.org> * pango/pango-layout.c (pango_layout_run_get_extents): * pango/glyphstring.c (pango_glyph_string_extents_range): Return if none of logical_rect or ink_rect is non-NULL. * pango/pango-item.h (PangoAnalysis): Add new member centered_baseline which if set, makes item rendered such that ascent == descent. * pango/pango-context.c (itemize_state_init), (itemize_state_add_character): * pango/pango-renderer.c (pango_renderer_draw_layout_line): Implement centered_baseline. * pango/pangocairo-fcfont.c (pango_cairo_fc_font_get_metrics): When adjusting ascent/descent for vertical fonts, adjust strikethrough and underline position too. * docs/tmpl/main.sgml: Document new struct member.
Diffstat (limited to 'pango/pangocairo-fcfont.c')
-rw-r--r--pango/pangocairo-fcfont.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pango/pangocairo-fcfont.c b/pango/pangocairo-fcfont.c
index 5ca9bcb2..0e503061 100644
--- a/pango/pangocairo-fcfont.c
+++ b/pango/pangocairo-fcfont.c
@@ -216,7 +216,7 @@ pango_cairo_fc_font_get_metrics (PangoFont *font,
if (!tmp_list)
{
PangoContext *context;
- int height;
+ int height, shift;
if (!fcfont->fontmap)
return pango_font_metrics_new ();
@@ -248,7 +248,13 @@ pango_cairo_fc_font_get_metrics (PangoFont *font,
case PANGO_GRAVITY_WEST:
info->metrics->ascent = height / 2;
}
- info->metrics->descent = height - info->metrics->ascent;
+ shift = (height - info->metrics->ascent) - info->metrics->descent;
+ if (fcfont->is_hinted)
+ shift &= ~(PANGO_SCALE - 1);
+ info->metrics->descent += shift;
+ info->metrics->underline_position -= shift;
+ info->metrics->strikethrough_position -= shift;
+ info->metrics->ascent = height - info->metrics->descent;
g_object_unref (context);
}