5

Consider the code:

\documentclass{book} \usepackage[sfdefault]{cabin} \usepackage[english]{babel} \usepackage{tikz,scalerel,scalefnt} \usetikzlibrary{decorations.text} \definecolor{PureGold}{RGB}{255,215,0} \tikzset{ mydecor/.style={ postaction={decorate, decoration={text along path, text align=center, raise=-1.8ex, text={|\color{black}\bfseries\sffamily\huge\scalefont{1.50}\,|#1}}}, postaction={decorate, decoration={text along path, text align=center, raise=-1.5ex, text={|\color{PureGold}\bfseries\sffamily\huge\scalefont{1.50}\,|#1}}} }} \begin{document} \thispagestyle{empty} \begin{center} \begin{tikzpicture} \draw[line width=30mm, red!50!black, mydecor=HOW TO STRETCH THE LETTERS?] (180:7.05)arc(180:0:7.05); \end{tikzpicture} \end{center} \end{document} 

which produces:

enter image description here

QUESTION: How may I vertically stretch the letters a bit? I compile the code with xelatex. I have tried, for example, placing \vstretch{} command into the code at different places, but to no avail.

Thank you.

2
  • 2
    You could put every letter in a \resizebox but that's tedious. Alternatively, the text effects along path puts every character in its own node where you could apply something like yscale=1.2 for the nodes. Commented May 3 at 1:59
  • I like the node option. Unfortunately, I do not think there is a way to deform them with the arch. Linear transformations on letters is possible, but not non-linear ones. Commented May 3 at 3:43

2 Answers 2

5

You could use the Condensed font or here for more dramatic effect, a mechanically condensed font that is just 60% of its normal width

enter image description here

\documentclass{book} \usepackage[english]{babel} \usepackage{tikz} \usetikzlibrary{decorations.text} \definecolor{PureGold}{RGB}{255,215,0} \usepackage{fontspec} \newfontfamily\csf[FakeStretch=.60]{Cabin-Bold}% or Bold Codensed might be better \tikzset{ mydecor/.style={ postaction={decorate, decoration={text along path, text align=center, raise=-1.8ex, text={|\color{black}\fontsize{45pt}{45pt}\csf\,|#1}}}, postaction={decorate, decoration={text along path, text align=center, raise=-1.5ex, text={|\color{PureGold}\fontsize{45pt}{45pt}\csf\,|#1}}} }} \begin{document} \thispagestyle{empty} \begin{center} \begin{tikzpicture} \draw[line width=30mm, red!50!black, mydecor=HOW TO STRETCH THE LETTERS?] (180:7.05)arc(180:0:7.05); \end{tikzpicture} \end{center} \end{document} 

or more extreme

enter image description here

\documentclass{book} \usepackage[english]{babel} \usepackage{tikz} \usetikzlibrary{decorations.text} \definecolor{PureGold}{RGB}{255,215,0} \usepackage{fontspec} \newfontfamily\csf[FakeStretch=.35]{Cabin-Bold}% or Bold Codensed might be better \tikzset{ mydecor/.style={ postaction={decorate, decoration={text along path, text align=center, raise=-3.8ex, text={|\color{black}\spaceskip=.1pt \fontsize{65pt}{45pt}\csf\,|#1}}}, postaction={decorate, decoration={text along path, text align=center, raise=-3.5ex, text={|\color{PureGold}\spaceskip=.1pt \fontsize{65pt}{45pt}\csf\,|#1}}} }} \begin{document} \thispagestyle{empty} \begin{center} \begin{tikzpicture} \draw[line width=30mm, red!50!black, mydecor=HOW TO STRETCH THE LETTERS?] (180:7.05)arc(180:0:7.05); \end{tikzpicture} \end{center} \end{document} 
0
4

You want to preprocess the text.

\documentclass[border=4]{standalone} \usepackage[sfdefault]{cabin} \usepackage{graphicx} \usepackage{tikz} \usetikzlibrary{decorations.text} \definecolor{PureGold}{RGB}{255,215,0} \tikzset{ mydecor/.style={ postaction={ decorate, decoration={ text along path, text align=center, raise=-4ex, text={|\color{PureGold}\fontsize{40}{0}\bfseries|#1} }, }, }, } \ExplSyntaxOn \NewDocumentCommand{\vstretch}{mm} { \tl_set:Ne #1 { \tl_map_function:nN {#2} \dds_stretch:n } } \cs_new_protected:Nn \dds_stretch:n { {\scalebox{1}[1.5]{#1}} } \ExplSyntaxOff \begin{document} \begin{tikzpicture} \vstretch{\mytext}{HOW~TO~STRETCH~THE~LETTERS?} \draw[ line width=30mm, red!50!black, mydecor=\mytext, ] (180:7.05)arc(180:0:7.05); \end{tikzpicture} \end{document} 

output

2
  • Thank you for posting this answer egreg; however, when I run the code, I get an error---underfine control sequence---related to \vstretch{\mytext{How...}}. I am using a 2023 version of Latex; could it be already outdated for the code you post? Commented May 3 at 12:02
  • @DDS Check the braces! \vstretch{\mytext}{How...} Commented May 3 at 12:26

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.