![对于非默认字体大小,“沿路径显示文本”装饰需要花费很长时间才能编译](https://linux22.com/image/288263/%E5%AF%B9%E4%BA%8E%E9%9D%9E%E9%BB%98%E8%AE%A4%E5%AD%97%E4%BD%93%E5%A4%A7%E5%B0%8F%EF%BC%8C%E2%80%9C%E6%B2%BF%E8%B7%AF%E5%BE%84%E6%98%BE%E7%A4%BA%E6%96%87%E6%9C%AC%E2%80%9D%E8%A3%85%E9%A5%B0%E9%9C%80%E8%A6%81%E8%8A%B1%E8%B4%B9%E5%BE%88%E9%95%BF%E6%97%B6%E9%97%B4%E6%89%8D%E8%83%BD%E7%BC%96%E8%AF%91.png)
我尝试使用,text along path
decoration
但tikz-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}