summaryrefslogtreecommitdiff
path: root/pango/pango-renderer.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2007-04-30 23:09:47 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2007-04-30 23:09:47 +0000
commitbd7f0529df20a3268815da365944979af441cd3a (patch)
treefb8ed8d2a77ed919f180f7197f89695b6fd8af84 /pango/pango-renderer.c
parent69bcc7f2e5ca2c7135e7ba558c85fffbce2426cb (diff)
downloadpango-bd7f0529df20a3268815da365944979af441cd3a.tar.gz
Move PANGO_UNITS_ROUND here... ...from here.
2007-04-30 Behdad Esfahbod <behdad@gnome.org> * pango/pango-types.h: Move PANGO_UNITS_ROUND here... * pango/pangofc-private.h: ...from here. * pango/pango-gravity.c: Document that pango_gravity_to_rotation() returns angle in radians but pango_matrix_rotate() takes degrees. * pango/pango-layout.c (pango_layout_run_get_extents): * pango/pango-renderer.c (pango_renderer_draw_layout_line): Retain metrics hinting when centering baseline (used for Latin, etc in vertical mode). * pango/pangocairo-fcfont.c (pango_cairo_fc_font_get_metrics), (pango_cairo_fc_font_glyph_extents_cache_init): Respect metrics hinting setting when moving glyphs around for vertical writing. * pango/pangocairo-fcfont.c (_pango_cairo_fc_font_new): Apply the gravity rotation before the pattern's matrix, such that vertical text gets correct italic direction. * pango/pangocairo-font.c (_pango_cairo_font_get_hex_box_info): Make hexbox font inherit most properties from the current font. That is, bold hexbox digits for a bold font, etc. svn path=/trunk/; revision=2238
Diffstat (limited to 'pango/pango-renderer.c')
-rw-r--r--pango/pango-renderer.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/pango/pango-renderer.c b/pango/pango-renderer.c
index daa877fb..02b8f479 100644
--- a/pango/pango-renderer.c
+++ b/pango/pango-renderer.c
@@ -516,7 +516,15 @@ pango_renderer_draw_layout_line (PangoRenderer *renderer,
state.logical_rect_end = x + x_off + glyph_string_width;
if (run->item->analysis.flags & PANGO_ANALYSIS_FLAG_CENTERED_BASELINE)
- rise += logical_rect.y + logical_rect.height / 2;
+ {
+ gboolean is_hinted = (logical_rect.y & logical_rect.height & (PANGO_SCALE - 1)) == 0;
+ int adjustment = logical_rect.y + logical_rect.height / 2;
+
+ if (is_hinted)
+ adjustment = PANGO_UNITS_ROUND (adjustment);
+
+ rise += adjustment;
+ }
if (renderer->priv->color_set[PANGO_RENDER_PART_BACKGROUND])