[Tex/LaTex] Curved text (on multiple lines) within curved arrow using tikz

arrowstikz-pgf

I have a curved arrow and want to put text inside of it (having the same curve as the arrow, of course). If the text is longer than the arrow, the text should be put on multiple lines (optimally with the arrow automatically getting thicker appropriately). See figure below.

(How) can I do this?

enter image description here


Update:

I now use

  \coordinate (specRoot) at (-10,0);
  \coordinate (testTreeRoot) at (0,0);
  \draw[->, >=latex, blue!20!white, line width=15pt, bend left]
  (specRoot) to (testTreeRoot);
  \path [decorate,decoration={text along path, text={traverse part of
      the STS and heuristically choose the best test tree}}]
     [out=30] (specRoot) to [in=130] (testTreeRoot);

But how can I combine the decorated text along the path and the actual arrow?

How can I do a carriage return, i.e. decorate two lines of text along a single path?


Update:

And now I use the following, in the file lazyOTFoverviewSmall.tex:

\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=2.2cm, semithick, mypostaction/.style 2 args={ 
        decoration={
            text align={
                left indent=#1},
                text along path,
                text={#2}
             },
         decorate
         }
  ]

  \begin{scope}[shift={(-10cm,0cm)}]
      \node[state] (specq0) {$q_0$};
  \end{scope}
  \begin{scope}
      \node[state] (q0) {$q_0$};
  \end{scope}

  \coordinate (specRoot) at (-10,0);
  \coordinate (testTreeRoot) at (0,0);

  \draw[-latex, blue!20!white, line width=5ex, bend left]
  (specRoot) ++(1cm,1cm)
  to (testTreeRoot) ++(-1cm,1cm);
  \path [postaction={mypostaction={1cm}{traverse part of the STS}},
postaction={mypostaction={1cm}{and heuristically choose the best test
    tree}, /pgf/decoration/raise=-3mm}]
     [out=30] (specRoot) ++(1cm,1cm) to [in=130] (testTreeRoot) ++(-1cm,1cm);
\end{tikzpicture}

and in master.tex I have:

\usepackage{tikz}
\usetikzlibrary{decorations.text}
\usetikzlibrary{backgrounds,shapes} %pictures
\usetikzlibrary{arrows,automata}

....

\begin{document}

...

\begin{figure}[hbt]
  \centering
  \scalebox{.7}{\input{gfx/MBT/lazyOTFoverviewSmall.tex}}
  \caption{Overview of Lazy On-the-fly MBT}\label{fig:lazyOTFoverview}
\end{figure}

....

Best Answer

TikZ is trying hard but text decorations are not really perfect as the text is decomposed into individual letters and spaces then boxed and rotated. So in general it needs further tweaks to make it look good. The main obstacle is the large arrowhead that changes the bending of the path to fit the arrowhead so the path needs to be adjusted manually. Here is a quick demo but I would recommend different paths for each line to be placed.

\documentclass[tikz]{standalone}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}[mypostaction/.style 2 args={
                         decoration={
                              text align={
                                    left indent=#1},
                                    text along path, 
                                    text={#2}
                                    },
                           decorate
                        }
                    ]
  \coordinate (specRoot) at (-10,0);
  \coordinate (testTreeRoot) at (0,0);
  \draw[-latex, blue!20!white, line width=5ex]  (specRoot) to[in=135,out=45] (testTreeRoot);

  \path [postaction={mypostaction={1cm}{traverse part of the STS}},
         postaction={mypostaction={1cm}{and heuristically choose the best test tree},
         /pgf/decoration/raise=-3mm}]
    (specRoot) to [in=120,out=45] (testTreeRoot);
\end{tikzpicture}
\end{document}

enter image description here