Consider this example:
\documentclass[margin=1cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}
\draw (0, 0) -- (2, 2);
\path [
postaction={decorate},
decoration={
text along path,
raise=0.2cm,
text={Text 2}
% text={\bf Text 2}
}
] (0, 0) -- (2, 2);
\node at (0, 2) {\bf Text 1};
\end{tikzpicture}
\end{document}
Compilation stops if I substitute
text={Text 2}
with
text={\bf Text 2}
How to have bold text decorations with tikz?
font=\bfserieswork? Note that\bfis deprecated in LaTeX and shouldn't be used anymore. – Phelype Oleinik Jul 08 '19 at 12:48font=\bfseriesdoesn't work – Viesturs Jul 08 '19 at 12:51text={|\bf|Text 2}– Mark Wibrow Jul 08 '19 at 13:01|\bf|works. Is it the correct form to use? – Viesturs Jul 08 '19 at 13:05