4

I'm trying to use a text along path decoration in tikz-pgf which causes absurd loading times, sometimes far longer than an hour if I want to print a whopping two (!!) words in for example \large font size. My code:

\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage[usenames,dvipsnames]{color}
\usepackage{tikz}
\usetikzlibrary{fadings,shapes.arrows,curvilinear,shadings,decorations.text}
\usepgfmodule{nonlineartransformations}
\pagenumbering{gobble}

\definecolor{lightblue}{RGB}{51,127,230}
\definecolor{olive2}{RGB}{64,196,0}
\definecolor{dorange}{RGB}{255,140,0}

\tikzfading[name=arrowfading, left color=transparent!0, right color=transparent!35]
\tikzset{
arrownode/.style={
    transform shape nonlinear=true,
    shape=double arrow, 
    line width=10mm,
    shape border rotate=180,
    upper left=cyan!25,
    lower left=dorange!5,
    upper right=olive!35,
    lower right=dorange!20,
    path fading=arrowfading
}
}
\makeatletter
\def\polartransformation{
\pgfmathsincos@{\pgf@x}
\pgf@x=\pgfmathresultx\pgf@y%
\pgf@y=\pgfmathresulty\pgf@y%
}
\makeatother

\begin{document}
\centering
\begin{tikzpicture}
\begin{scope}[remember picture,overlay,shift={(-5,-5)}]
\pgftransformnonlinear{\polartransformation}
\node[arrownode,shading angle=0] (a) at (1.5*pi,-5) {\phantom{\hspace{2cm}Gleidende schaal\hspace{4cm}}};
\path[decorate,decoration={text along path, % this is the culprit
                text={\Huge{G L E I D E N D E S C H A A L}},
                text align=center,
                raise=-0.5ex
                }](a.west) -- (a.east);
\end{scope}
\end{tikzpicture}
\end{document}

I'm considering externalization, but that would still require an actual print by the software, thus far yielding little result.

  • 4
    Instead of text={\Huge{G L E I D E N D E S C H A A L}}, use text={|\Huge|G L E I D E N D E S C H A A L}. See text format delimiters p. 603 of pgfmanual v3.0 – Paul Gaborit Apr 13 '14 at 20:39
  • @PaulGaborit, a quick answer for this one? – Paul Gessler Jan 10 '15 at 16:14
  • 1
    @PaulGessler Done... – Paul Gaborit Jan 11 '15 at 1:23
7

Instead of text={\Huge{G L E I D E N D E S C H A A L}}, use text={|\Huge|G L E I D E N D E S C H A A L} (see section "text format delimiters" p.603 of pgfmanual v3.0).

enter image description here

\documentclass{standalone}
\usepackage[usenames,dvipsnames]{color}
\usepackage{tikz}
\usetikzlibrary{fadings,shapes.arrows,curvilinear,shadings,decorations.text}
\usepgfmodule{nonlineartransformations}
\pagenumbering{gobble}

\definecolor{lightblue}{RGB}{51,127,230}
\definecolor{olive2}{RGB}{64,196,0}
\definecolor{dorange}{RGB}{255,140,0}

\tikzfading[name=arrowfading, left color=transparent!0, right color=transparent!35]
\tikzset{
arrownode/.style={
    transform shape nonlinear=true,
    shape=double arrow, 
    line width=10mm,
    shape border rotate=180,
    upper left=cyan!25,
    lower left=dorange!5,
    upper right=olive!35,
    lower right=dorange!20,
    path fading=arrowfading
}
}
\makeatletter
\def\polartransformation{
\pgfmathsincos@{\pgf@x}
\pgf@x=\pgfmathresultx\pgf@y%
\pgf@y=\pgfmathresulty\pgf@y%
}
\makeatother

\begin{document}
\begin{tikzpicture}
  \begin{scope}

\pgftransformnonlinear{\polartransformation}
\node[arrownode,shading angle=0] (a) at (1.5*pi,-5) {\phantom{\hspace{2cm}Gleidende schaal\hspace{4cm}}};
\path[decorate,decoration={text along path, % this is the culprit
                text={|\Huge|G L E I D E N D E S C H A A L},
                text align=center,
                raise=-0.5ex
                }](a.west) -- (a.east);
  \end{scope}
\end{tikzpicture}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.