0

I was trying to change the typeface of some text that I wrote in a tikzpicture. I have tried a few things, but none of them seem to work. What I current have is

\begin{tikzpicture}[scale=0.4] \path [decorate, decoration={text along path, text={Sample Text}, text align={center}}] (-30,8) .. controls (-15,22) and (15,22) .. (30,8) ; \end{tikzpicture} 

but I would like to change the typeface to qag from the tgadventor font package. Does anyone know how I might be able to do this? I have also had difficulties changing the font colour.

4
  • 3
    If you know how to switch on the font in a normal document, you can just use the command on the text. Assume the command is \myfont. Then you can use text={|\myfont|Sample Text}, i.e. add the command between two |. Commented Apr 6, 2020 at 4:50
  • Thank you @Schrödinger'scat. Commented Apr 6, 2020 at 6:54
  • 1
    You're welcome! Color can be added in the same way, e.g. text={|\sffamily\color{red}|Sample Text}. I just do not know how to use tgadventor. Commented Apr 6, 2020 at 7:03
  • @Schrödinger'scat: How can one remove a question from unanswered list (questions like this that has been answered in comment)? Isn't better convert your comment to answer? Commented Apr 8, 2020 at 16:51

1 Answer 1

3

You can add the font information in the text wrapped in the text format delimiters, the default of which is |.

\documentclass[tikz,border=3mm]{standalone} \usetikzlibrary{decorations.text} \usepackage{tgadventor} %\usepackage[matchuppercase]{tgadventor} \begin{document} \begin{tikzpicture}[scale=0.4] \path [decorate, decoration={text along path, text={|\itshape\color{blue}|Sample Text}, text align={center}}] (-30,8) .. controls (-15,22) and (15,22) .. (30,8) ; \path [yshift=-1cm,decorate, decoration={text along path, text={|\sffamily\color{red}|Sample Text}, text align={center}}] (-30,8) .. controls (-15,22) and (15,22) .. (30,8) ; \end{tikzpicture} \end{document} 

enter image description here

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.