演示tikz中文字沿路径摆放

演示tikz中文字沿路径摆放:

%演示文字沿路径摆放 
\begin{tikzpicture}
\path decorate [decoration={text along path,
text={some text along a path}}]{ (0,2) .. controls (2,2) and (1,0) .. (3,0) }; 
\draw  (0,2) .. controls (2,2) and (1,0) .. (3,0);  
\end{tikzpicture}  

效果如下:

但是tikz没有封装命令\decorate,但是下面的用法是可以的:

\tikz \draw decorate[decoration=zigzag] {(0,0) -- (3,0)};
对于decoration的定义示例如下:

\pgfdeclaredecoration{stars}{initial}{
\state{initial}[width=15pt]
{
\pgfmathparse{round(rnd*100)}
\pgfsetfillcolor{yellow!\pgfmathresult!orange}
\pgfsetstrokecolor{yellow!\pgfmathresult!red}
\pgfnode{star}{center}{}{}{\pgfusepath{stroke,fill}}
}
\state{final}
{
\pgfpathmoveto{\pgfpointdecoratedpathlast}
}
}
\tikz\path[decorate, decoration=stars, star point ratio=2, star points=5,
inner sep=0, minimum size=rnd*10pt+2pt]
(0,0) .. controls (0,2) and (3,2) .. (3,0)
.. controls (3,-3) and (0,0) .. (0,-3)
.. controls (0,-5) and (3,-5) .. (3,-3);
效果如下:


  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值