Index: src/print-cell.c
===================================================================
RCS file: /cvs/gnome/gnumeric/src/print-cell.c,v
retrieving revision 1.118
diff -u -r1.118 print-cell.c
--- src/print-cell.c	23 Jun 2004 02:42:04 -0000	1.118
+++ src/print-cell.c	18 Sep 2004 05:51:59 -0000
@@ -53,12 +53,22 @@
  */
 
 static inline void
-print_text (GnomePrintContext *context,
+print_text (GnomePrintContext *context, GnomeFont *font,
 	    double x, double text_base, char const *text, double len_pts,
 	    double const * const line_offset, int num_lines)
 {
-	gnome_print_moveto (context, x, text_base);
-	gnome_print_show (context, text);
+    gdouble DPI=96; /* FIXME what is the dpi ? */
+    PangoLayout *layout = (PangoLayout *)(gnome_print_pango_create_layout (context));
+    PangoFontDescription* pangofont = (PangoFontDescription *)(gnome_font_get_pango_description (font, DPI));
+    int pango_layout_width;
+    int pango_layout_height;
+    
+    gnome_print_moveto (context, x, text_base);
+    pango_layout_set_font_description (layout, pangofont);
+    pango_layout_set_text (layout, text, -1);
+    pango_layout_get_pixel_size (layout, &pango_layout_width, &pango_layout_height);
+    gnome_print_moveto (context, x, text_base + pango_layout_height);
+    gnome_print_pango_layout (context, layout);
 
 	/* FIXME how to handle small fonts ?
 	 * the text_base should be at least 2 pixels above the bottom */
@@ -88,7 +98,7 @@
 	else if (count >= sizeof (hashes))
 		count = sizeof (hashes) - 1;
 	x1 += (width - count*len) / 2; /* Center */
-	print_text (context, x1, text_base, hashes + sizeof (hashes) - count - 1,
+	print_text (context, font, x1, text_base, hashes + sizeof (hashes) - count - 1,
 		    count*len, line_offset, num_lines);
 }
 
@@ -396,7 +406,7 @@
 		gnome_print_setfont (context, print_font);
 		total = len; /* don't include partial copies after the first */
 		do {
-			print_text (context, x, text_base, text, len,
+			print_text (context, print_font, x, text_base, text, len,
 				    line_offset, num_lines);
 
 			x += len;
@@ -481,7 +491,7 @@
 				x = rect_x + h_center - len / 2;
 			}
 
-			print_text (context,
+			print_text (context, print_font,
 				    x, y1 - y_offset, str,
 				    len, line_offset, num_lines);
 
