Index: pango/pangocairo-fcfont.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangocairo-fcfont.c,v
retrieving revision 1.46
diff -u -p -d -r1.46 pangocairo-fcfont.c
--- pango/pangocairo-fcfont.c	28 Nov 2006 21:17:39 -0000	1.46
+++ pango/pangocairo-fcfont.c	13 Dec 2006 22:57:48 -0000
@@ -46,8 +46,6 @@ typedef struct _GlyphExtentsCacheEntry  
 #define GLYPH_CACHE_NUM_ENTRIES 256 /* should be power of two */
 #define GLYPH_CACHE_MASK (GLYPH_CACHE_NUM_ENTRIES - 1)
 
-#define PANGO_UNITS(Double) ((int)floor((Double) * PANGO_SCALE + 0.5))
-
 /* An entry in the fixed-size cache for the glyph -> ink_rect mapping.
  * The cache is indexed by the lower N bits of the glyph (see
  * GLYPH_CACHE_NUM_ENTRIES).  For scripts with few glyphs,
Index: pango/pangocairo-private.h
===================================================================
RCS file: /cvs/gnome/pango/pango/pangocairo-private.h,v
retrieving revision 1.13
diff -u -p -d -r1.13 pangocairo-private.h
--- pango/pangocairo-private.h	28 Nov 2006 21:47:51 -0000	1.13
+++ pango/pangocairo-private.h	13 Dec 2006 22:57:48 -0000
@@ -113,6 +113,8 @@ struct _PangoCairoWarningHistory {
 
 extern PangoCairoWarningHistory _pango_cairo_warning_history;
 
+#define PANGO_UNITS(Double) ((int)floor((Double) * PANGO_SCALE + 0.5))
+
 G_END_DECLS
 
 #endif /* __PANGOCAIRO_PRIVATE_H__ */
Index: pango/pangocairo-render.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangocairo-render.c,v
retrieving revision 1.32
diff -u -p -d -r1.32 pangocairo-render.c
--- pango/pangocairo-render.c	4 Dec 2006 20:23:35 -0000	1.32
+++ pango/pangocairo-render.c	13 Dec 2006 22:57:48 -0000
@@ -196,6 +196,9 @@ pango_cairo_renderer_draw_glyphs (PangoR
   int x_position = 0;
   cairo_glyph_t *cairo_glyphs;
   cairo_glyph_t stack_glyphs[MAX_STACK];
+  double base_x = crenderer->x_offset + (double)x / PANGO_SCALE;
+  double base_y = crenderer->y_offset + (double)y / PANGO_SCALE;
+  int fixed_x = PANGO_UNITS (base_x);
 
   cairo_save (crenderer->cr);
   if (!crenderer->do_path)
@@ -209,10 +212,10 @@ pango_cairo_renderer_draw_glyphs (PangoR
 
 	  if (gi->glyph != PANGO_GLYPH_EMPTY)
 	    {
-	      double cx = crenderer->x_offset +
-			  (double)(x + x_position + gi->geometry.x_offset) / PANGO_SCALE;
-	      double cy = crenderer->y_offset +
-			  (double)(y + gi->geometry.y_offset) / PANGO_SCALE;
+	      double cx = (double)(fixed_x + x_position + gi->geometry.x_offset) / PANGO_SCALE;
+	      double cy = gi->geometry.y_offset == 0 ?
+			  base_y :
+			  base_y + (double)(gi->geometry.y_offset) / PANGO_SCALE;
 
 	      _pango_cairo_renderer_draw_unknown_glyph (crenderer, font, gi, cx, cy);
 	    }	  
@@ -234,10 +237,10 @@ pango_cairo_renderer_draw_glyphs (PangoR
 
       if (gi->glyph != PANGO_GLYPH_EMPTY)
         {
-          double cx = crenderer->x_offset +
-		      (double)(x + x_position + gi->geometry.x_offset) / PANGO_SCALE;
-          double cy = crenderer->y_offset +
-		      (double)(y + gi->geometry.y_offset) / PANGO_SCALE;
+          double cx = (double)(fixed_x + x_position + gi->geometry.x_offset) / PANGO_SCALE;
+          double cy = gi->geometry.y_offset == 0 ?
+		      base_y :
+		      base_y + (double)(gi->geometry.y_offset) / PANGO_SCALE;
 
           if (gi->glyph & PANGO_GLYPH_UNKNOWN_FLAG)
 	    _pango_cairo_renderer_draw_unknown_glyph (crenderer, font, gi, cx, cy);

