3

I've got the following sample latex file I'm using with luatex:

\documentclass{standalone}

\usepackage{tikz}
\usetikzlibrary{decorations.text}

\begin{document}
\begin{tikzpicture}

    \draw (0, 0) circle (3);

    \path[%
        decorate,
        decoration={%
        text along path,
        text={The quick brown fox jumped over the lazy dogs.},
        text align=center}
        ] (0, 3) arc (90:450:3);

\end{tikzpicture}
\end{document}

It gives me the following:

enter image description here

If I load a font using fontspec/setmainfont, how do I go about changing the font of the text that's displayed along the path?

And while I'm at it, is there a way to "lift" the text off the circle without having to manually calculate a smaller radius for the text arc? Is there some sort of yoffset parameter I can set?

  • The raise key allows you to move the text up. – user121799 Nov 19 '18 at 4:30
1

I think if you set a font for the document, it will be used in these decorations. You can lift the path up by using the raise key.

\documentclass{standalone}

\usepackage{tikz}
\usepackage{fontspec}

\setmainfont{DejaVu Sans}
\usetikzlibrary{decorations.text}

\begin{document}
\begin{tikzpicture}

    \draw (0, 0) circle (3);

    \path[%
        decorate,
        decoration={%
        raise=8pt,
        text along path,
        text={The quick brown fox jumped over the lazy dogs.},
        text align=center}
        ] (0, 3) arc (90:450:3);

\end{tikzpicture}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.