1

I am trying to draw a large colored text along a path, where the color follows a gradient.

I found posts describing how to draw text along a path and posts showing how to draw colored text with gradients, but the two techniques don't seem to mix as easily.

The effect I'm trying to obtain is shown in the picture below:enter image description here

Any idea how I could obtain this?

--- EDIT 2 ---

Preferably, I'd like to have a gradient visible on each character rather than a single, solid color on each character.

--- EDIT ---

I tried to mix a text along a path, like the following one:

\resizebox{0.5\linewidth}{!}{
\begin{tikzpicture}
\draw[left color=orange!30, right color = orange,decoration={text along path,
      text={|\Huge\bfseries|GRADIENT},text align={center}},font=\tiny,decorate] (155:2.75) arc (155:25:2.75);
\end{tikzpicture}
}

with a colored text with gradient, e.g.:

\begin{tikzfadingfrompicture}[name=mypic]
  \node [text=transparent!20]
    {\fontfamily{ptm}\fontsize{45}{45}\bfseries\selectfont GRADIENT};
\end{tikzfadingfrompicture}
\begin{tikzpicture}
    \fill [white] (-5,-1) rectangle (5,1);
  \shade[path fading=mypic,fit fading=false, left color=orange!30,right color=orange]
    (-5,-1) rectangle (5,1);
\end{tikzpicture}

but I have no idea how to use my first tikzpicture as a tikzfadingfrompicture. Simply replacing one for the other as follows (of course) doesn't work:

\begin{tikzfadingfrompicture}[name=mypic]
\draw[text=transparent!20,decoration={text along path,
      text={|\Huge\bfseries|GRADIENT},text align={center}},font=\tiny,decorate] (155:2.75) arc (155:25:2.75);
\end{tikzfadingfrompicture}
\begin{tikzpicture}
    \fill [white] (-5,-1) rectangle (5,1);
  \shade[path fading=mypic,fit fading=false, left color=orange!30,right color=orange]
    (-5,-1) rectangle (5,1);
\end{tikzpicture}
Maiaux
  • 227

1 Answers1

3

My try: (Reference: pgfmanual.pdf (V3.1.1), p. 651)

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.text,math}
\begin{document}

\bfseries \begin{tikzpicture}[decoration={text effects along path, text={GRADIENT}, text align={center}, text effects/.cd, character count=\i, character total=\n, characters={text along path, evaluate={\c=\i/\n*100;}, text=brown!\c!black}}] \path [decorate] (0,2) .. controls ++(0,1) and ++(0,1) .. (2,2); \end{tikzpicture} \end{document}

enter image description here