# How to have a text decorated circumference automatically equal to the length of the text?

I would like to have some text decorated circles with their circumference automatically equal to the length of the text.

That is something like my MWE but without calculating the radius manually by trial and error.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}
\path[draw,
postaction={decorate,decoration={%
text={egreg~},
text along path,
text align=right,
raise=-10pt,
}}
]
\path[draw,
postaction={decorate,decoration={%
text={David Carlisle~},
text along path,
text align=right,
raise=-10pt,
}}
]
\path[draw,
postaction={decorate,decoration={%
text={Herr Prof.\ Paulinho van Duck~},
text along path,
text align=right,
raise=-10pt,
}}
]
\end{tikzpicture}
\end{document}


• oi why is David upside down, I'm getting dizzy – David Carlisle Nov 12 '17 at 10:14

Put the text into a new length register, for example,

\newlength\circl
\settowidth\circl{Herr Prof.\ Paulinho van Duck duck duck~}


this should be the circumference of the circle, then do the math. To get the radius from circumference, r = circumference/2pi, or put it like this radius=.1591549\circl, where .1591549 = 1/2pi.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\begin{document}
\newlength\circl
\settowidth\circl{Herr Prof.\ Paulinho van Duck duck duck~}
\begin{tikzpicture}
\path[draw,
postaction={decorate,decoration={%
text={egreg~},
text along path,
text align=right,
raise=-10pt,
}}
]
\path[draw,
postaction={decorate,decoration={%
text={David Carlisle~},
text along path,
text align=right,
raise=-10pt,
}}
]