[Tex/LaTex] Curved text within a curved arrow

tikz-arrowstikz-pgf

I am trying to get the text that I place inside a curved arrow to curve with the arrow. I have the following code that generates that given picture, but I wonder how I can get the text to curve with the arrow. I have found a solution proposal here, but I could not adapt it to my case. In particular, I would really like to get the definition of vecArrow to be modified to do what I want (ideally with the text as an argument). Any help would be appreciated.

\documentclass[table,xcolor=pdftex,dvipsnames]{beamer}

\usepackage{tikz}

\usetikzlibrary{arrows,shapes,snakes,positioning,decorations.text,decorations.pathmorphing,decorations.markings}

\begin{document}

\begin{frame}
   \frametitle{Curved Arrow}
 \tikzset{
vecArrow/.style={
  line width=3ex,
  decoration={markings,mark=at position
   1 with {\arrow[scale=2, blue!20!white]{triangle 60}}},
    blue!20!white,
  shorten >= 32pt,
  line width=4pt,
  preaction = {decorate},
  postaction = {draw=blue!20!white,line width=3ex, shorten >= 30pt}
  }
}

\begin{tikzpicture}
\node[rectangle,draw,minimum width=2in, minimum height=1in] (box1) {};
\node[rectangle,draw,minimum width=2in, minimum height=1.5in,below right=of box1] (box2) {};
\draw[vecArrow]  (box1.east) to[in=135,out=45] node[black,rotate=-47,anchor=west,xshift=-6mm]{\scriptsize Subgraph Match} (box2.north);

\end{tikzpicture}

\end{frame}
\end{document}

enter image description here

Best Answer

Here is one way to do it:

\documentclass[table,xcolor=pdftex,dvipsnames]{beamer}

\usepackage{tikz}

\usetikzlibrary{arrows.meta,bending,positioning,decorations.text}

\begin{document}
  \tikzset{
    vecArrow/.style={
      draw, line width=3ex, blue!20!white, -{Triangle[bend, angle=60:1pt 2]}, shorten >=6pt, postaction=decorate, decoration={text along path, text color=black, text align=center, text={|\scriptsize|#1 ||}}
    }
  }
  \begin{frame}
    \frametitle{Curved Arrow}
    \begin{tikzpicture}
      \node[rectangle,draw,minimum width=2in, minimum height=1in] (box1) {};
      \node[rectangle,draw,minimum width=2in, minimum height=1.5in,below right=of box1] (box2) {};
      \path [vecArrow=Subgraph Match] (box1.east) to[in=135,out=45] (box2.north);
    \end{tikzpicture}
  \end{frame}
\end{document}

Text on curved arrow