Index: gimp/app/Makefile.am
===================================================================
RCS file: /cvs/gnome/gimp/app/Makefile.am,v
retrieving revision 1.354
diff -u -p -r1.354 Makefile.am
--- gimp/app/Makefile.am	9 Aug 2005 23:58:32 -0000	1.354
+++ gimp/app/Makefile.am	2 Nov 2005 15:16:24 -0000
@@ -87,7 +87,7 @@ INCLUDES = \
 	$(PANGOFT2_CFLAGS)	\
 	-I$(includedir)
 
-gimp_2_3_LDFLAGS = $(mwindows)
+gimp_2_3_LDFLAGS = -ugimp_vectors_warp_vectors $(mwindows)
 
 gimp_2_3_LDADD = \
 	gui/libappgui.a			\
@@ -135,6 +135,8 @@ gimp_console_2_3_SOURCES = $(app_sources
 gimp_console_2_3_CPPFLAGS = \
 	$(AM_CPPFLAGS)			\
 	-DGIMP_CONSOLE_COMPILATION
+
+gimp_console_2_3_LDFLAGS = -ugimp_vectors_warp_vectors
 
 gimp_console_2_3_LDADD = \
 	widgets/widgets-enums.o		\
Index: gimp/app/text/gimptextlayer.c
===================================================================
RCS file: /cvs/gnome/gimp/app/text/gimptextlayer.c,v
retrieving revision 1.64
diff -u -p -r1.64 gimptextlayer.c
--- gimp/app/text/gimptextlayer.c	12 Apr 2005 21:36:53 -0000	1.64
+++ gimp/app/text/gimptextlayer.c	2 Nov 2005 15:16:24 -0000
@@ -36,6 +36,8 @@
 #include "paint-funcs/paint-funcs.h"
 
 #include "core/gimp.h"
+#include "core/gimpchannel.h"
+#include "core/gimpchannel-select.h"
 #include "core/gimpcontext.h"
 #include "core/gimpcontainer.h"
 #include "core/gimpimage.h"
@@ -43,6 +45,9 @@
 #include "core/gimpimage-undo-push.h"
 #include "core/gimpparasitelist.h"
 
+#include "vectors/gimpvectors.h"
+#include "vectors/gimpvectors-warp.h"
+
 #include "gimptext.h"
 #include "gimptext-bitmap.h"
 #include "gimptext-private.h"
@@ -50,6 +55,7 @@
 #include "gimptextlayer-transform.h"
 #include "gimptextlayout.h"
 #include "gimptextlayout-render.h"
+#include "gimptext-vectors.h"
 
 #include "gimp-intl.h"
 
@@ -58,7 +64,8 @@ enum
 {
   PROP_0,
   PROP_AUTO_RENAME,
-  PROP_MODIFIED
+  PROP_MODIFIED,
+  PROP_RENDER_ALONG_PATH
 };
 
 static void       gimp_text_layer_class_init     (GimpTextLayerClass *klass);
@@ -100,9 +107,14 @@ static void       gimp_text_layer_push_u
                                                   gint            height);
 
 static void       gimp_text_layer_text_notify    (GimpTextLayer  *layer);
+static void       gimp_text_layer_text_path_modified
+                                                 (GimpTextLayer  *layer);
 static gboolean   gimp_text_layer_render         (GimpTextLayer  *layer);
 static void       gimp_text_layer_render_layout  (GimpTextLayer  *layer,
                                                   GimpTextLayout *layout);
+static gboolean   gimp_text_layer_render_text_warped
+                                                 (GimpTextLayer  *layer);
+static gboolean   gimp_text_layer_render_idle    (gpointer        data);
 
 
 static GimpLayerClass *parent_class = NULL;
@@ -185,6 +197,10 @@ gimp_text_layer_class_init (GimpTextLaye
                                     "modified", NULL,
                                     FALSE,
                                     0);
+  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_RENDER_ALONG_PATH,
+                                    "render-along-path", NULL,
+                                    FALSE,
+                                    0);
 }
 
 static void
@@ -192,12 +208,14 @@ gimp_text_layer_init (GimpTextLayer *lay
 {
   layer->text          = NULL;
   layer->text_parasite = NULL;
+  layer->text_path     = NULL;
 }
 
 static void
 gimp_text_layer_finalize (GObject *object)
 {
   GimpTextLayer *layer = GIMP_TEXT_LAYER (object);
+  GimpImage     *gimage = gimp_item_get_image (GIMP_ITEM (layer));
 
   if (layer->text)
     {
@@ -205,6 +223,12 @@ gimp_text_layer_finalize (GObject *objec
       layer->text = NULL;
     }
 
+  if (layer->text_path)
+    {
+      gimp_image_remove_vectors (gimage, layer->text_path);
+      layer->text_path = NULL;
+    }
+
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
@@ -224,6 +248,9 @@ gimp_text_layer_get_property (GObject   
     case PROP_MODIFIED:
       g_value_set_boolean (value, text_layer->modified);
       break;
+    case PROP_RENDER_ALONG_PATH:
+      g_value_set_boolean (value, text_layer->render_along_path);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;
@@ -246,6 +273,9 @@ gimp_text_layer_set_property (GObject   
     case PROP_MODIFIED:
       text_layer->modified = g_value_get_boolean (value);
       break;
+    case PROP_RENDER_ALONG_PATH:
+      text_layer->render_along_path = g_value_get_boolean (value);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;
@@ -265,6 +295,10 @@ gimp_text_layer_get_memsize (GimpObject 
     memsize += gimp_object_get_memsize (GIMP_OBJECT (text_layer->text),
                                         gui_size);
 
+  if (text_layer->text_path)
+    memsize += gimp_object_get_memsize (GIMP_OBJECT (text_layer->text_path),
+                                        gui_size);
+
   return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
                                                                   gui_size);
 }
@@ -301,6 +335,18 @@ gimp_text_layer_duplicate (GimpItem *ite
       g_object_unref (text);
     }
 
+  if (layer->text_path)
+    {
+      GimpVectors *path;
+      GimpImage   *gimage = gimp_item_get_image (GIMP_ITEM (layer));
+
+      path = GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (layer->text_path),
+                                                GIMP_TYPE_VECTORS, FALSE));
+
+      gimp_image_add_vectors (gimage, path, -1);
+      gimp_text_layer_set_text_path (new_layer, path);
+    }
+
   /*  this is just the parasite name, not a pointer to the parasite  */
   if (layer->text_parasite)
     new_layer->text_parasite = layer->text_parasite;
@@ -465,6 +511,60 @@ gimp_text_layer_get_text (GimpTextLayer 
   return layer->text;
 }
 
+/*
+ * gimp_text_layer_set_text_path:
+ * @layer: Text layer for which to set path
+ * @path:  A #GimpVectors item to set as the path
+ *
+ * Sets the the specified Vectors item as the text path for the
+ * specified layer.  Note that this function removes the old
+ * path-vectors from the image but does not add the new one,
+ * so that should have been done before this function is
+ * called.
+ */
+void
+gimp_text_layer_set_text_path (GimpTextLayer *layer,
+                               GimpVectors   *path)
+{
+  GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (layer));
+
+  g_return_if_fail (GIMP_IS_TEXT_LAYER (layer));
+  g_return_if_fail (path == NULL || GIMP_IS_VECTORS (path));
+
+  if (layer->text_path == path)
+    return;
+
+  if (layer->text_path)
+    {
+      g_signal_handlers_disconnect_by_func (layer->text_path,
+                                            G_CALLBACK (gimp_text_layer_text_path_modified),
+                                            layer);
+
+      gimp_image_remove_vectors (gimage, layer->text_path);
+    }
+
+  if (path)
+    {
+      layer->text_path = path;
+      g_object_add_weak_pointer (G_OBJECT (path),
+                                 (gpointer *) &layer->text_path);
+
+      g_signal_connect_object (path, "thaw",
+                               G_CALLBACK (gimp_text_layer_text_path_modified),
+                               layer, G_CONNECT_SWAPPED);
+    }
+
+  gimp_viewable_invalidate_preview (GIMP_VIEWABLE (layer));
+}
+
+GimpVectors *
+gimp_text_layer_get_text_path (GimpTextLayer *layer)
+{
+  g_return_val_if_fail (GIMP_IS_TEXT_LAYER (layer), NULL);
+
+  return layer->text_path;
+}
+
 void
 gimp_text_layer_set (GimpTextLayer *layer,
                      const gchar   *undo_desc,
@@ -530,6 +630,7 @@ gimp_text_layer_discard (GimpTextLayer *
                                    layer, NULL);
 
   gimp_text_layer_set_text (layer, NULL);
+  gimp_text_layer_set_text_path( layer, NULL);
 }
 
 gboolean
@@ -557,6 +658,30 @@ gimp_text_layer_text_notify (GimpTextLay
   gimp_text_layer_render (layer);
 }
 
+static void
+gimp_text_layer_text_path_modified (GimpTextLayer *layer)
+{
+  static gint idle_id = 0;
+
+  if (idle_id)
+    {
+      g_source_remove (idle_id);
+      idle_id = 0;
+    }
+
+  idle_id = g_idle_add (gimp_text_layer_render_idle, layer);
+}
+
+static gboolean
+gimp_text_layer_render_idle (gpointer data)
+{
+  GimpTextLayer *layer = GIMP_TEXT_LAYER (data);
+
+  gimp_text_layer_render (layer);
+
+  return (FALSE);
+}
+
 static gboolean
 gimp_text_layer_render (GimpTextLayer *layer)
 {
@@ -570,6 +695,11 @@ gimp_text_layer_render (GimpTextLayer *l
   if (! layer->text)
     return FALSE;
 
+  if (layer->render_along_path)
+    {
+      return gimp_text_layer_render_text_warped (layer);
+    }
+
   drawable = GIMP_DRAWABLE (layer);
   item     = GIMP_ITEM (layer);
   image    = gimp_item_get_image (item);
@@ -670,3 +800,88 @@ gimp_text_layer_render_layout (GimpTextL
    *  did that for us.
    */
 }
+
+#define TEXT_LAYER_PADDING 20
+
+static gboolean
+gimp_text_layer_render_text_warped (GimpTextLayer *layer)
+{
+  GimpVectors  *vectors;
+  GimpItem     *item            = GIMP_ITEM (layer);
+  GimpDrawable *drawable        = GIMP_DRAWABLE (layer);
+  GimpDrawable *mask;
+  GimpImage    *image;
+  gdouble       x1, y1, x2, y2;
+  gint          width, height;
+  gint          offset_x, offset_y;
+  PixelRegion   textPR;
+  PixelRegion   maskPR;
+  gint          padding         = TEXT_LAYER_PADDING;
+  if (! layer->text || ! layer->text_path)
+    return FALSE;
+
+  image = item->gimage;
+
+  g_object_freeze_notify (G_OBJECT (drawable));
+
+  vectors = gimp_text_vectors_new (image, layer->text);
+  gimp_vectors_warp_vectors (layer->text_path, vectors, 0.0);
+
+  gimp_vectors_bounds (vectors, &x1, &y1, &x2, &y2);
+  width  = x2 - x1 + 2 * padding;
+  height = y2 - y1 + 2 * padding;
+
+  gimp_channel_select_vectors (gimp_image_get_mask (image),
+                               _("Meaningless undo desc"),
+                               vectors,
+                               GIMP_CHANNEL_OP_REPLACE,
+                               TRUE, FALSE, 0, 0);
+
+  g_object_unref (G_OBJECT (vectors));
+
+  if (width  != gimp_item_width (item) || height != gimp_item_height (item))
+    {
+      TileManager *new_tiles = tile_manager_new (width, height,
+                                                 drawable->bytes);
+
+      gimp_drawable_set_tiles (drawable, FALSE, NULL, new_tiles);
+
+      tile_manager_unref (new_tiles);
+
+      if (GIMP_LAYER (layer)->mask)
+        {
+          static GimpContext *unused_eek = NULL;
+
+          if (! unused_eek)
+            unused_eek = gimp_context_new (image->gimp, "eek", NULL);
+
+          gimp_item_resize (GIMP_ITEM (GIMP_LAYER (layer)->mask), unused_eek,
+                            width, height, 0, 0);
+        }
+    }
+
+  gimp_item_offsets (item, &offset_x, &offset_y);
+  offset_x += padding;
+  offset_y += padding;
+
+  if (offset_x != x1 || offset_y != y1)
+    gimp_item_translate (item, x1 - offset_x, y1 - offset_y, TRUE);
+
+  gimp_drawable_fill (drawable, &layer->text->color, NULL);
+
+  pixel_region_init (&textPR, drawable->tiles,
+		     0, 0, width, height, TRUE);
+
+  mask = GIMP_DRAWABLE (gimp_image_get_mask (image));
+  pixel_region_init (&maskPR, mask->tiles,
+		     x1 - padding, y1 - padding, width, height, FALSE);
+
+  apply_mask_to_region (&textPR, &maskPR, OPAQUE_OPACITY);
+
+  gimp_channel_clear (gimp_image_get_mask (image), NULL, TRUE);
+
+  g_object_thaw_notify (G_OBJECT (drawable));
+
+  return (width > 0 && height > 0);
+}
+
Index: gimp/app/text/gimptextlayer.h
===================================================================
RCS file: /cvs/gnome/gimp/app/text/gimptextlayer.h,v
retrieving revision 1.13
diff -u -p -r1.13 gimptextlayer.h
--- gimp/app/text/gimptextlayer.h	27 Sep 2005 17:31:32 -0000	1.13
+++ gimp/app/text/gimptextlayer.h	2 Nov 2005 15:16:24 -0000
@@ -47,6 +47,9 @@ struct _GimpTextLayer
                                  */
   gboolean      auto_rename;
   gboolean      modified;
+
+  gboolean      render_along_path;
+  GimpVectors  *text_path;
 };
 
 struct _GimpTextLayerClass
@@ -62,6 +65,9 @@ GimpLayer * gimp_text_layer_new         
 GimpText  * gimp_text_layer_get_text    (GimpTextLayer *layer);
 void        gimp_text_layer_set_text    (GimpTextLayer *layer,
                                          GimpText      *text);
+void        gimp_text_layer_set_text_path (GimpTextLayer *layer,
+                                           GimpVectors   *path);
+GimpVectors * gimp_text_layer_get_text_path (GimpTextLayer *layer);
 void        gimp_text_layer_discard     (GimpTextLayer *layer);
 void        gimp_text_layer_set         (GimpTextLayer *layer,
                                          const gchar   *undo_desc,
Index: gimp/app/tools/gimptextoptions.c
===================================================================
RCS file: /cvs/gnome/gimp/app/tools/gimptextoptions.c,v
retrieving revision 1.63
diff -u -p -r1.63 gimptextoptions.c
--- gimp/app/tools/gimptextoptions.c	3 Sep 2005 16:01:15 -0000	1.63
+++ gimp/app/tools/gimptextoptions.c	2 Nov 2005 15:16:24 -0000
@@ -62,7 +62,8 @@ enum
   PROP_JUSTIFICATION,
   PROP_INDENTATION,
   PROP_LINE_SPACING,
-  PROP_LETTER_SPACING
+  PROP_LETTER_SPACING,
+  PROP_RENDER_ALONG_PATH
 };
 
 
@@ -188,6 +189,10 @@ gimp_text_options_class_init (GimpTextOp
                                    N_("Adjust letter spacing"),
                                    -8192.0, 8192.0, 0.0,
                                    GIMP_CONFIG_PARAM_DEFAULTS);
+  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_RENDER_ALONG_PATH,
+                                    "render-along-path", NULL,
+                                    FALSE,
+                                    0);
 }
 
 static void
@@ -239,6 +244,9 @@ gimp_text_options_get_property (GObject 
     case PROP_LETTER_SPACING:
       g_value_set_double (value, options->letter_spacing);
       break;
+    case PROP_RENDER_ALONG_PATH:
+      g_value_set_boolean (value, options->render_along_path);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;
@@ -289,6 +297,9 @@ gimp_text_options_set_property (GObject 
     case PROP_LETTER_SPACING:
       options->letter_spacing = g_value_get_double (value);
       break;
+    case PROP_RENDER_ALONG_PATH:
+      options->render_along_path = g_value_get_boolean (value);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;
@@ -419,7 +430,7 @@ gimp_text_options_gui (GimpToolOptions *
 
   g_object_set_data (G_OBJECT (tool_options), "tool-options-vbox", vbox);
 
-  table = gtk_table_new (10, 3, FALSE);
+  table = gtk_table_new (11, 3, FALSE);
   gtk_table_set_col_spacings (GTK_TABLE (table), 2);
   gtk_table_set_row_spacings (GTK_TABLE (table), 2);
   gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
@@ -490,21 +501,19 @@ gimp_text_options_gui (GimpToolOptions *
   gimp_table_attach_stock (GTK_TABLE (table), row++,
                            GIMP_STOCK_LETTER_SPACING, spinbutton, 1, TRUE);
 
-  button = gtk_button_new_with_label (_("Create Path from Text"));
-  gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
-  gtk_widget_set_sensitive (button, FALSE);
+  button = gimp_prop_check_button_new (config, "render-along-path", _("Render along path"));
+  gtk_table_attach (GTK_TABLE (table), button, 0, 3, row, row + 1,
+                    GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (button);
+  row++;
 
-  g_object_set_data (G_OBJECT (tool_options),
-                     "gimp-text-to-vectors", button);
-
-  button = gtk_button_new_with_label (_("Text along Path"));
+  button = gtk_button_new_with_label (_("Create Path from Text"));
   gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
   gtk_widget_set_sensitive (button, FALSE);
   gtk_widget_show (button);
 
   g_object_set_data (G_OBJECT (tool_options),
-                     "gimp-text-to-vectors-warped", button);
+                     "gimp-text-to-vectors", button);
 
   return vbox;
 }
Index: gimp/app/tools/gimptextoptions.h
===================================================================
RCS file: /cvs/gnome/gimp/app/tools/gimptextoptions.h,v
retrieving revision 1.10
diff -u -p -r1.10 gimptextoptions.h
--- gimp/app/tools/gimptextoptions.h	2 Mar 2005 12:54:54 -0000	1.10
+++ gimp/app/tools/gimptextoptions.h	2 Nov 2005 15:16:24 -0000
@@ -50,6 +50,8 @@ struct _GimpTextOptions
   gdouble                line_spacing;
   gdouble                letter_spacing;
 
+  gboolean               render_along_path;
+
   GimpSizeEntry         *size_entry;
 };
 
Index: gimp/app/tools/gimptexttool.c
===================================================================
RCS file: /cvs/gnome/gimp/app/tools/gimptexttool.c,v
retrieving revision 1.254
diff -u -p -r1.254 gimptexttool.c
--- gimp/app/tools/gimptexttool.c	27 Sep 2005 18:51:42 -0000	1.254
+++ gimp/app/tools/gimptexttool.c	2 Nov 2005 15:16:24 -0000
@@ -54,7 +54,9 @@
 #include "widgets/gimptexteditor.h"
 #include "widgets/gimpviewabledialog.h"
 
+#include "vectors/gimpvectors.h"
 #include "vectors/gimpvectors-warp.h"
+#include "vectors/gimpbezierstroke.h"
 
 #include "display/gimpdisplay.h"
 
@@ -108,8 +110,6 @@ static gboolean  gimp_text_tool_idle_app
 static void      gimp_text_tool_apply          (GimpTextTool      *text_tool);
 
 static void      gimp_text_tool_create_vectors (GimpTextTool      *text_tool);
-static void      gimp_text_tool_create_vectors_warped
-                                               (GimpTextTool      *text_tool);
 static void      gimp_text_tool_create_layer   (GimpTextTool      *text_tool,
                                                 GimpText          *text);
 
@@ -126,6 +126,13 @@ static gboolean  gimp_text_tool_set_draw
                                                 GimpDrawable      *drawable,
                                                 gboolean           confirm);
 
+static GimpVectors *gimp_text_tool_create_path (GimpImage         *image,
+                                                gint32             x1,
+                                                gint32             y1);
+static void gimp_text_options_notify_render_along_path
+                                               (GimpContext       *context,
+                                                GParamSpec        *pspec,
+                                                GimpTextTool      *text_tool);
 
 /*  local variables  */
 
@@ -248,7 +255,13 @@ gimp_text_tool_constructor (GType       
 static void
 gimp_text_tool_dispose (GObject *object)
 {
-  GimpTextTool *text_tool = GIMP_TEXT_TOOL (object);
+  GimpTextTool    *text_tool = GIMP_TEXT_TOOL (object);
+  GimpTool        *tool      = GIMP_TOOL (object);
+  GimpTextOptions *options   = GIMP_TEXT_OPTIONS (tool->tool_info->tool_options);
+
+  g_signal_handlers_disconnect_by_func (options,
+                                        gimp_text_options_notify_render_along_path,
+                                        text_tool);
 
   gimp_text_tool_set_drawable (text_tool, NULL, FALSE);
 
@@ -365,11 +378,9 @@ gimp_text_tool_connect (GimpTextTool  *t
     {
       GimpTextOptions *options;
       GtkWidget       *button;
-      GtkWidget       *button2;
 
       options = GIMP_TEXT_OPTIONS (tool->tool_info->tool_options);
       button  = g_object_get_data (G_OBJECT (options), "gimp-text-to-vectors");
-      button2 = g_object_get_data (G_OBJECT (options), "gimp-text-to-vectors-warped");
 
       if (text_tool->text)
         {
@@ -388,14 +399,6 @@ gimp_text_tool_connect (GimpTextTool  *t
                                                     text_tool);
             }
 
-          if (button2)
-            {
-              gtk_widget_set_sensitive (button2, FALSE);
-              g_signal_handlers_disconnect_by_func (button2,
-                                                    gimp_text_tool_create_vectors_warped,
-                                                    text_tool);
-            }
-
           g_object_unref (text_tool->text);
           text_tool->text = NULL;
 
@@ -424,14 +427,6 @@ gimp_text_tool_connect (GimpTextTool  *t
               gtk_widget_set_sensitive (button, TRUE);
             }
 
-          if (button2)
-            {
-              g_signal_connect_swapped (button2, "clicked",
-                                        G_CALLBACK (gimp_text_tool_create_vectors_warped),
-                                        text_tool);
-              gtk_widget_set_sensitive (button2, TRUE);
-            }
-
           if (text_tool->editor)
             gimp_text_tool_editor_update (text_tool);
         }
@@ -439,6 +434,10 @@ gimp_text_tool_connect (GimpTextTool  *t
 
   if (text_tool->layer != layer)
     {
+      GimpTextOptions *options;
+
+      options = GIMP_TEXT_OPTIONS (tool->tool_info->tool_options);
+
       if (text_tool->layer)
         {
           g_signal_handlers_disconnect_by_func (text_tool->layer,
@@ -449,10 +448,23 @@ gimp_text_tool_connect (GimpTextTool  *t
 
       text_tool->layer = layer;
 
+
       if (layer)
-        g_signal_connect_object (text_tool->layer, "notify::modified",
-                                 G_CALLBACK (gimp_text_tool_layer_notify),
-                                 text_tool, 0);
+        {
+          g_signal_connect_object (text_tool->layer, "notify::modified",
+                                   G_CALLBACK (gimp_text_tool_layer_notify),
+                                   text_tool, 0);
+
+          g_signal_handlers_disconnect_by_func (options,
+                                                gimp_text_options_notify_render_along_path,
+                                                text_tool);
+          g_object_set (options,
+                        "render-along-path", layer->render_along_path,
+                        NULL);
+          g_signal_connect (options, "notify::render-along-path",
+                            G_CALLBACK (gimp_text_options_notify_render_along_path),
+                            text_tool);
+        }
     }
 }
 
@@ -681,40 +693,14 @@ gimp_text_tool_create_vectors (GimpTextT
 }
 
 static void
-gimp_text_tool_create_vectors_warped (GimpTextTool *text_tool)
-{
-  GimpVectors   *vectors0;
-  GimpVectors   *vectors;
-  GimpText      *text      = text_tool->text;
-  gdouble        box_height;
-
-  if (! text || ! text_tool->image || ! text_tool->layer)
-    return;
-
-  box_height = gimp_item_height (GIMP_ITEM (text_tool->layer));
-
-  vectors0 = gimp_image_get_active_vectors (text_tool->image);
-  if (! vectors0)
-    return;
-
-  vectors = gimp_text_vectors_new (text_tool->image, text_tool->text);
-
-  gimp_vectors_warp_vectors (vectors0, vectors, 0.5 * box_height);
-
-  gimp_image_add_vectors (text_tool->image, vectors, -1);
-  gimp_image_set_active_vectors (text_tool->image, vectors);
-  gimp_item_set_visible (GIMP_ITEM (vectors), TRUE, FALSE);
-
-  gimp_image_flush (text_tool->image);
-}
-
-static void
 gimp_text_tool_create_layer (GimpTextTool *text_tool,
                              GimpText     *text)
 {
-  GimpTool  *tool = GIMP_TOOL (text_tool);
-  GimpImage *image;
-  GimpLayer *layer;
+  GimpTool      *tool = GIMP_TOOL (text_tool);
+  GimpImage     *image;
+  GimpLayer     *layer;
+  GimpTextLayer *text_layer;
+  GimpVectors   *text_path;
 
   if (text)
     {
@@ -737,13 +723,14 @@ gimp_text_tool_create_layer (GimpTextToo
 
   image = tool->gdisp->gimage;
   layer = gimp_text_layer_new (image, text);
+  text_layer = GIMP_TEXT_LAYER (layer);
 
   g_object_unref (text);
 
   if (! layer)
     return;
 
-  gimp_text_tool_connect (text_tool, GIMP_TEXT_LAYER (layer), text);
+  gimp_text_tool_connect (text_tool, text_layer, text);
 
   gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TEXT,
                                _("Add Text Layer"));
@@ -766,6 +753,9 @@ gimp_text_tool_create_layer (GimpTextToo
 
   gimp_image_add_layer (image, layer, -1);
 
+  text_path = gimp_text_tool_create_path (image, text_tool->x1, text_tool->y1);
+  gimp_text_layer_set_text_path (text_layer, text_path);
+
   gimp_image_undo_group_end (image);
 
   gimp_image_flush (image);
@@ -1055,3 +1045,57 @@ gimp_text_tool_set_layer (GimpTextTool *
   if (gimp_text_tool_set_drawable (text_tool, GIMP_DRAWABLE (layer), TRUE))
     gimp_text_tool_editor (text_tool);
 }
+
+/*
+ * gimp_text_path_create()
+ *
+ * This function creates an initial text path for a new text layer.
+ * The path is a line extending from the upper left corner of the text
+ * horizontally to the right edge of the image
+ */
+static GimpVectors *
+gimp_text_tool_create_path (GimpImage *image,
+                            gint32     x1,
+                            gint32     y1)
+{
+  GimpVectors *vectors;
+  GimpStroke  *stroke;
+  GimpCoords   coords;
+  GimpAnchor  *anchor;
+
+  vectors = gimp_vectors_new (image, _("Text Path"));
+  gimp_image_add_vectors (image, vectors, -1);
+  stroke = gimp_bezier_stroke_new ();
+  gimp_vectors_stroke_add (vectors, stroke);
+
+  coords.x = x1;
+  coords.y = y1;
+
+  anchor = gimp_bezier_stroke_extend (stroke, &coords, NULL, EXTEND_EDITABLE);
+
+  coords.x = gimp_image_get_width (image);
+
+  gimp_bezier_stroke_extend (stroke, &coords, anchor, EXTEND_EDITABLE);
+
+  return vectors;
+}
+
+static void
+gimp_text_options_notify_render_along_path (GimpContext  *context,
+                                            GParamSpec   *pspec,
+                                            GimpTextTool *text_tool)
+{
+  GimpTextOptions *options = GIMP_TEXT_OPTIONS (context);
+
+  if (text_tool->layer)
+    {
+      g_object_set (text_tool->layer,
+                    "render-along-path", options->render_along_path,
+                    NULL);
+
+      gimp_item_set_visible (GIMP_ITEM (text_tool->layer->text_path),
+                             options->render_along_path,
+                             TRUE);
+    }
+}
+
