tikz 文本装饰:文本方向

tikz 文本装饰:文本方向

考虑这个例子:

\documentclass[margin=0.2cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes, decorations.text}
\begin{document}
\begin{tikzpicture}
  \coordinate (A) at (0.0, 0.0);
  \coordinate (B) at (-5.0, 5.0);
  \draw[red, ->,
  postaction={decorate,decoration={text effects along path,
    text={sample text}, text align=center,
    text effects/.cd,
      text along path,
      every character/.style={ yshift=0.5ex}}}] (A) arc (0:90:5);
\end{tikzpicture}
\end{document}

如何在不改变弧线中的任何内容的情况下改变文本“示例文本”的方向。

在此处输入图片描述

答案1

reverse path

\documentclass[margin=0.2cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes, decorations.text}
\begin{document}
\begin{tikzpicture}
  \coordinate (A) at (0.0, 0.0);
  \coordinate (B) at (-5.0, 5.0);
  \draw[red, ->,
  postaction={decorate,decoration={text effects along path,
    text={sample text}, text align=center, reverse path,
    text effects/.cd,
      text along path, 
      every character/.style={
      yshift=0.5ex}}}] (A) arc (0:90:5);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容