TransWikia.com

Writing text on a curve in tikz

TeX - LaTeX Asked by Troy W. on December 5, 2020

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.

One Answer

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={|itshapecolor{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={|sffamilycolor{red}|Sample Text}, text align={center}}]
       (-30,8) .. controls (-15,22) and (15,22) .. (30,8) ;
end{tikzpicture}
end{document}

enter image description here

Answered by user194703 on December 5, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP