diff --git a/app/text/gimptextlayer.c b/app/text/gimptextlayer.c
index 779af21..d5c19ff 100644
--- a/app/text/gimptextlayer.c
+++ b/app/text/gimptextlayer.c
@@ -637,66 +637,101 @@ gimp_text_layer_render_layout (GimpTextLayer  *layer,
 {
   GimpDrawable    *drawable = GIMP_DRAWABLE (layer);
   GimpItem        *item     = GIMP_ITEM (layer);
-  TileManager     *mask;
+  GimpImage       *image    = gimp_item_get_image (item);
   cairo_t         *cr;
-  cairo_surface_t *surface;
-  PixelRegion      textPR;
-  PixelRegion      maskPR;
-  const guchar    *data;
-  gint             rowstride;
+  cairo_surface_t *rgb_surface;
+  cairo_surface_t *alpha_surface;
+  PixelRegion      layerPR;
+  const guchar    *rgb_data;
+  const guchar    *alpha_data;
+  GimpImageType    layer_type;
+  gint             layer_alpha_byte;
+  gint             rgb_rowstride;
+  gint             alpha_rowstride;
   gint             width;
   gint             height;
   gpointer         pr;
 
-  gimp_drawable_fill (drawable, &layer->text->color, NULL);
+  g_return_if_fail (gimp_drawable_has_alpha (drawable));
 
   width  = gimp_item_get_width  (item);
   height = gimp_item_get_height (item);
 
-  surface = cairo_image_surface_create (CAIRO_FORMAT_A8, width, height);
+  rgb_surface   = cairo_image_surface_create (CAIRO_FORMAT_RGB24, width, height);
+  alpha_surface = cairo_image_surface_create (CAIRO_FORMAT_A8,    width, height);
 
-  cr = cairo_create (surface);
+  cr = cairo_create (rgb_surface);
+  gimp_text_layout_render (layout, cr, layer->text->base_dir, FALSE);
+  cairo_destroy (cr);
 
+  cr = cairo_create (alpha_surface);
   gimp_text_layout_render (layout, cr, layer->text->base_dir, FALSE);
+  cairo_destroy (cr);
 
-  mask = tile_manager_new ( width, height, 1);
-  pixel_region_init (&maskPR, mask, 0, 0, width, height, TRUE);
+  pixel_region_init (&layerPR, gimp_drawable_get_tiles (drawable),
+                     0, 0, width, height, TRUE);
 
-  cairo_surface_flush (surface);
+  layer_type       = gimp_drawable_type (drawable);
+  layer_alpha_byte = layerPR.bytes - 1;
 
-  data      = cairo_image_surface_get_data (surface);
-  rowstride = cairo_image_surface_get_stride (surface);
+  cairo_surface_flush (rgb_surface);
+  rgb_data      = cairo_image_surface_get_data (rgb_surface);
+  rgb_rowstride = cairo_image_surface_get_stride (rgb_surface);
 
-  for (pr = pixel_regions_register (1, &maskPR);
+  cairo_surface_flush (alpha_surface);
+  alpha_data      = cairo_image_surface_get_data (alpha_surface);
+  alpha_rowstride = cairo_image_surface_get_stride (alpha_surface);
+
+  for (pr = pixel_regions_register (1, &layerPR);
        pr != NULL;
        pr = pixel_regions_process (pr))
     {
-      const guchar *src  = data + maskPR.x + maskPR.y * rowstride;
-      guchar       *dest = maskPR.data;
-      gint          rows = maskPR.h;
+      const guchar *rgb_src;
+      const guchar *alpha_src;
+      guchar       *dest = layerPR.data;
+      gint          rows = layerPR.h;
+
+      rgb_src   = rgb_data   + layerPR.x * 4 + layerPR.y * rgb_rowstride;
+      alpha_src = alpha_data + layerPR.x     + layerPR.y * alpha_rowstride;
 
       while (rows--)
         {
-          memcpy (dest, src, maskPR.w);
+          const guchar *rgb   = rgb_src;
+          const guchar *alpha = alpha_src;
+          guchar       *d     = dest;
+          gint          i;
+
+          for (i = 0; i < layerPR.w; i++)
+            {
+              guchar color[3];
+
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+#define GIMP_CAIRO_RGB24_GET_PIXEL(s, r, g, b)                          \
+              G_STMT_START { (b) = s[0]; (g) = s[1]; (r) = s[2]; } G_STMT_END
+#else
+#define GIMP_CAIRO_RGB24_GET_PIXEL(s, r, g, b)                          \
+              G_STMT_START { (r) = s[1]; (g) = s[2]; (b) = s[3]; } G_STMT_END
+#endif
 
-          src += rowstride;
-          dest += maskPR.rowstride;
-        }
-    }
+              GIMP_CAIRO_RGB24_GET_PIXEL (rgb, color[0], color[1], color[2]);
 
-  cairo_destroy (cr);
-  cairo_surface_destroy (surface);
+              gimp_image_transform_color (image, layer_type, d,
+                                          GIMP_RGB, color);
+              d[layer_alpha_byte] = *alpha;
 
-  pixel_region_init (&textPR, gimp_drawable_get_tiles (drawable),
-                     0, 0, width, height, TRUE);
-  pixel_region_init (&maskPR, mask,
-                     0, 0, width, height, FALSE);
+              rgb   += 4;
+              alpha += 1;
+              d     += layerPR.bytes;
+            }
 
-  apply_mask_to_region (&textPR, &maskPR, OPAQUE_OPACITY);
+          rgb_src   += rgb_rowstride;
+          alpha_src += alpha_rowstride;
+          dest      += layerPR.rowstride;
+        }
+    }
 
-  tile_manager_unref (mask);
+  cairo_surface_destroy (rgb_surface);
+  cairo_surface_destroy (alpha_surface);
 
-  /*  no need to gimp_drawable_update() since gimp_drawable_fill()
-   *  did that for us.
-   */
+  gimp_drawable_update (drawable, 0, 0, width, height);
 }
