I have a couple of questions about text decoration in tikz
when the text is longer than the path to decorate:
- Why doesn't the decoration begin at the beginning of the line (whereas it is correctly truncated at the end)?
- Why there is too much/not enough horizontal space between letters when the text is bent, if a negative
raise
is used?
See here:
\documentclass[a4paper]{book}
\usepackage{tikz}
\usetikzlibrary{decorations.text,shapes}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix[column sep=7em,row sep=7ex]{%
\draw[postaction={decorate,decoration={text along path,text align=center,
text={Why doesn't this begin at the beginning of the line?}}}]
(0,0) to (1,0);
&
\draw[postaction={decorate,decoration={text along path,text align=center,
text={Idem as the previous one}}}]
(0,0) to[bend right] (1,0);
&
\draw[postaction={decorate,decoration={text along path,text align=center,
text={Idem as the previous one}}}]
(0,0) to[bend left] (1,0);
\\
\draw[postaction={decorate,decoration={text along path,text align=center,raise=-3ex,
text={Idem as the previous one}}}]
(0,0) to (1,0);
&
\draw[postaction={decorate,decoration={text along path,text align=center,raise=-3ex,
text={Moreover, why is there so much space between the bended letters?}}}]
(0,0) to[bend right] (1,0);
&
\draw[postaction={decorate,decoration={text along path,text align=center,raise=-3ex,
text={Moreover, why is there so little space between the bended letters?}}}]
(0,0) to[bend left] (1,0);
\\
};
\end{tikzpicture}
\end{document}
Edit:
Symbol 1 explained why this happens, but I still don't understand the reason.
Wouldn't the following one be a more coherent behavior?
Or even the following one?
Is it only because it's too difficult to do it automatically?
P.S. = This question arises because I'd like to explain what I intended with "horizontally squashed" in a comment of mine to this cfr's answer.