增加 TiKZ 文本装饰中的字母间距

增加 TiKZ 文本装饰中的字母间距

我一直在尝试增加下图中字母之间的间距: 在此处输入图片描述

\documentclass[12pt]{standalone}
\usepackage{tikz}
\usepackage{fontspec}
\setmainfont{Brill}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}
\draw [white] (-10,0) -- (-8,0) node [black, midway] {West};
\draw [white] (0,8) -- (0,11) node [black, rotate=90, midway] {North};
\draw [white] (8,0) -- (10,0) node [black, midway] {East};
\draw [white] (0,-8) -- (0,-11)  node [black, rotate=90, midway] {South};
\draw (-8,0) -- (8,0);
\draw (0,-8) -- (0,8);


\path[decorate,decoration={raise=-18pt, text along path, text={North East},text align=center}] (0,8) arc (90:0:8cm);
\draw [thick] (0,8) arc (90:0:8cm); 
\path[decorate,decoration={raise=-18pt, text along path, text={North West},text align=center, reverse path}] (0,8) arc (90:180:8cm);
\draw [thick] (0,8) arc (90:180:8cm);
\path[decorate,decoration={raise=-18pt, text along path, text={South West},text align=center, reverse path}] (-8,0) arc (180:270:8cm);
\draw [thick] (-8,0) arc (180:270:8cm);
\path[decorate,decoration={raise=-18pt, text along path, text={South East},text align=center, reverse path}] (0,-8) arc (270:360:8cm);
\draw [thick] (0,-8) arc (270:360:8cm);

\path[decorate,decoration={raise=18pt, text along path, text={N o r t h  E a s t},text align=center}] (0,8) arc (90:0:8cm);
\draw [thick] (0,8) arc (90:0:8cm); 
\path[decorate,decoration={raise=18pt, text along path, text={N o r t h  W e s t},text align=center, reverse path}] (0,8) arc (90:180:8cm);
\draw [thick] (0,8) arc (90:180:8cm);
\path[decorate,decoration={raise=18pt, text along path, text={S o u t h  W e s t},text align=center, reverse path}] (-8,0) arc (180:270:8cm);
\draw [thick] (-8,0) arc (180:270:8cm);
\path[decorate,decoration={raise=18pt, text along path, text={S o u t h  E a s t},text align=center, reverse path}] (0,-8) arc (270:360:8cm);
\draw [thick] (0,-8) arc (270:360:8cm);


\node  [above] at     (0,8) {\textit{b}};
\node  [below] at     (0,-8) {\textit{d}};
\node  [left] at     (-8,0) {\textit{a}};
\node  [right] at     (8,0) {\textit{c}};

\end{tikzpicture}
\end{document}

理想情况下,如果不是因为系统将两个空格算作一个空格,结果应该是圆外的装饰。我不想使用此选项,fit to path因为文本在整个圆弧上被拉伸了。您有什么建议吗(如果您发现任何不一致之处)?谢谢!

答案1

大部分都是题外话(关于如何使代码更简洁的一些想法),对于圆外路径上的文本的解决方案与@marmoth 答案中的相同:

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{fontspec}
% \setmainfont{Brill}
\usetikzlibrary{decorations.text}

\begin{document}
\begin{tikzpicture}[
textA/.style args = {#1/#2}{decorate,
    decoration={raise= 18pt, text along path, text=#1, 
    text align=fit to path, #2}}, % #2 for reversed path
textB/.style args = {#1/#2}{decorate,
    decoration={raise=-18pt, text along path, text=#1,
    text align=center, #2}}, % #2 for reversed path
                    ]
\node [left]    at (-8.4,0) {West};
\node [above,anchor=west,rotate=90] at (0, 8.4) {North};
\node [right]   at (8.4,0)  {East};
\node [below,anchor=east,rotate=90] at (0,-8.4) {South};
\draw   (-8,0) -- (8,0) 
        (0,-8) -- (0,8);
%
\path[textB=North East/ ] (0,8) arc (90:0:8cm);
\path[textB=North West/reverse path] ( 0,8) arc (90:180:8cm);
\path[textB=South West/reverse path] (-8,0) arc (180:270:8cm);
\path[textB=South East/reverse path] (0,-8) arc (270:360:8cm);
%
\path[textA=North East/ ]            (60:8) arc (60:30:8cm);
\path[textA=North West/reverse path] (120:8) arc (120:150:8cm);
\path[textA=South West/reverse path] (210:8) arc (210:240:8cm);
\path[textA=South East/reverse path] (300:8) arc (300:330:8cm);
%
\draw [thick] (0,0) circle[radius=8cm];
%
\node[above] at (0,8)   {$b$};
\node[below] at (0,-8)  {$d$};
\node[left]  at (-8,0)  {$a$};
\node[right] at (8,0)   {$c$};
    \end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

这是使用的建议text align=fit to path。我没有您的字体。

\documentclass[tikz,border=3.14mm]{standalone}
% \usepackage{fontspec}
% \setmainfont{Brill}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}
\draw [white] (-10,0) -- (-8,0) node [black, midway] {West};
\draw [white] (0,8) -- (0,11) node [black, rotate=90, midway] {North};
\draw [white] (8,0) -- (10,0) node [black, midway] {East};
\draw [white] (0,-8) -- (0,-11)  node [black, rotate=90, midway] {South};
\draw (-8,0) -- (8,0);
\draw (0,-8) -- (0,8);


\path[decorate,decoration={raise=-18pt, text along path, text={North East},text align=center}] (0,8) arc (90:0:8cm);
\draw [thick] (0,8) arc (90:0:8cm); 
\path[decorate,decoration={raise=-18pt, text along path, text={North West},text align=center, reverse path}] (0,8) arc (90:180:8cm);
\draw [thick] (0,8) arc (90:180:8cm);
\path[decorate,decoration={raise=-18pt, text along path, text={South West},text align=center, reverse path}] (-8,0) arc (180:270:8cm);
\draw [thick] (-8,0) arc (180:270:8cm);
\path[decorate,decoration={raise=-18pt, text along path, text={South East},text align=center, reverse path}] (0,-8) arc (270:360:8cm);
\draw [thick] (0,-8) arc (270:360:8cm);

\path[decorate,decoration={raise=18pt, text along path,text align=fit to path,
 text={North East},text align=center}] (60:8) arc (60:30:8cm);
\draw [thick] (0,8) arc (90:00:8cm); 
\path[decorate,decoration={raise=18pt, text along path,text align=fit to path, 
text={North West},text align=center, reverse path}] (120:8) arc (120:150:8cm);
\draw [thick] (0,8) arc (90:180:8cm);
\path[decorate,decoration={raise=18pt, text along path,text align=fit to path, 
text={South West},text align=center, reverse path}] (210:8) arc (210:240:8cm);
\draw [thick] (-8,0) arc (180:270:8cm);
\path[decorate,decoration={raise=18pt, text along path,text align=fit to path, 
text={South East},text align=center, reverse path}] (300:8) arc (300:330:8cm);
\draw [thick] (0,-8) arc (270:360:8cm);


\node  [above] at     (0,8) {\textit{b}};
\node  [below] at     (0,-8) {\textit{d}};
\node  [left] at     (-8,0) {\textit{a}};
\node  [right] at     (8,0) {\textit{c}};

\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容