Index: kit/draw.c
diff -u kit/draw.c:1.249 kit/draw.c:1.250
--- kit/draw.c:1.249	Sun Jun 20 18:45:24 2010
+++ kit/draw.c	Mon Oct 15 03:25:10 2012
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: draw.c,v 1.249 2010/06/20 09:45:24 nishida Exp $
+ * $Id: draw.c,v 1.250 2012/10/14 18:25:10 nishida Exp $
  */
 
 #include "mgp.h"
@@ -5319,6 +5319,7 @@
 			return p;
 		}
 
+#ifndef USE_XFT2
 		for (i = 2; i < len; i ++){
 			XftTextExtents8(display, xft_font, (XftChar8 *)p, len -i, &extents);
 			if (state->width - state->leftfillpos / 2 - state->linewidth >= extents.xOff){
@@ -5335,6 +5336,12 @@
 			return p +len;
 		} else 
 			return NULL;
+#else
+		draw_line_end(state); 
+	 	draw_line_start(state);
+		state->linewidth = state->leftfillpos;
+		return p;
+#endif
 	}
 
 nofolding:
@@ -5603,7 +5610,7 @@
 		h = w * xyratio+1;
 		x = zx[id] + xstep * i;
 		y = zy[id] + ystep * i;
-		pixmap = pixmap_fromimimage(zimage[id], w, h); 
+		pixmap = pixmap_fromimimage(zimage[id], w, h, window); 
 		manage_pixmap(pixmap, 1, zpage[id]);
 		if (i > 0) clear_region(id, i-1, i, 0); 
 		XCopyArea(display, pixmap, window, gcfore, 0,0, w, h, x, y); 
@@ -5634,7 +5641,7 @@
 		h = w * xyratio+1;
 		x = zx[id] + xstep * i;
 		y = zy[id] + ystep * i;
-		pixmap = pixmap_fromimimage(zimage[id], w, h); 
+		pixmap = pixmap_fromimimage(zimage[id], w, h, window); 
 		manage_pixmap(pixmap, 1, zpage[id]);
 		if (i < ratio) clear_region(id, i+1, i, 0);
 		XCopyArea(display, pixmap, window, gcfore, 0, 0, w, h, x, y); 
Index: kit/image/imlib_loader.c
diff -u kit/image/imlib_loader.c:1.10 kit/image/imlib_loader.c:1.11
--- kit/image/imlib_loader.c:1.10	Wed Feb 18 19:44:31 2009
+++ kit/image/imlib_loader.c	Mon Oct 15 03:17:29 2012
@@ -132,15 +132,18 @@
 	imnum ++;
 }
 
-Pixmap pixmap_fromimimage(imimage, width, height)
+Pixmap pixmap_fromimimage(imimage, width, height, window)
 	Imlib_Image *imimage;
 	int width, height;
+	Window window; 
 {
-	static Pixmap pixmap;
+	static Pixmap pixmap; 
 #if 0
 	Imlib_render(id, imimage, width, height);
 	pixmap = Imlib_move_image(id, imimage);
 #else
+	imlib_context_set_image (imimage);
+	imlib_context_set_drawable (window);
 	imlib_render_pixmaps_for_whole_image_at_size(&pixmap, NULL, width, height);
 #endif
 
