对于非默认字体大小,“沿路径显示文本”装饰需要花费很长时间才能编译

对于非默认字体大小,“沿路径显示文本”装饰需要花费很长时间才能编译

我尝试使用,text along path decorationtikz-pgf会导致加载时间过长,有时如果我想打印两个 (!!) 个单词(例如\large字体大小),加载时间会远远超过一个小时。我的代码:

\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}

我正在考虑外部化,但这仍然需要软件的实际打印,因此到目前为止收效甚微。

答案1

text={\Huge{G L E I D E N D E S C H A A L}}不要使用 ,而要使用text={|\Huge|G L E I D E N D E S C H A A L}(请参阅 pgfmanual v3.0 的第 603 页“文本格式分隔符”部分)。

在此处输入图片描述

\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}

相关内容