1

I want to have a circular flow including persian words (employing xepersian package and xelatex compiler is necessary for persian language) using tikz picture, but latex makes characters of persian words separated. how I can fix it?

\documentclass[parskip]{scrartcl}
\usepackage[margin=15mm]{geometry}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\usepackage{xepersian}
\settextfont{XB Niloofar}

\newcommand{\arcarrow}[8]% inner radius, middle radius, outer radius, start angle, end angle, tip protusion angle, options, text
{   \pgfmathsetmacro{\rin}{#1}
\pgfmathsetmacro{\rmid}{#2}
\pgfmathsetmacro{\rout}{#3}
\pgfmathsetmacro{\astart}{#4}
\pgfmathsetmacro{\aend}{#5}
\pgfmathsetmacro{\atip}{#6}
\fill[#7] (\astart:\rin) arc (\astart:\aend:\rin) -- (\aend+\atip:\rmid) -- (\aend:\rout) arc (\aend:\astart:\rout) -- (\astart+\atip:\rmid) -- cycle;
\path[decoration={text along path, text={#8}, text align={align=center}, raise=-0.5ex},decorate] (\astart+\atip:\rmid) arc (\astart+\atip:\aend+\atip:\rmid);
}

\begin{document}

\begin{tikzpicture}
 \fill[even odd rule,lime!30] circle (3.8) circle (3.2);
 \arcarrow{3}{3.5}{4}{0}{118}{5}{magenta,draw=red!50!black,very thick}{کاهش ارزش آورده}
 \arcarrow{3}{3.5}{4}{120}{238}{5}{green,draw=red!50!black,very thick}{{کاهش ارزش آورده}}
 \arcarrow{3}{3.5}{4}{240}{358}{5}{cyan,draw=red!50!black,very thick}{{کاهش ارزش آورده}}
\end{tikzpicture}

\end{document}
  • 1
    I tried to compile your document but the kpfonts package is necessary and it is impossible for me to install it via Texmaker or via the MikTeXconsole. "The required file fonts\afm\public\kpfonts\jkplmne.afm is missing. It is a part of the following package: kpfonts There's always that error: "Unfortunately, the package kpfonts could not be installed" – AndréC Sep 15 '18 at 20:17
  • tex.stackexchange.com/q/410820 seems relevant, but I’m not experienced enough with tikz to apply it to your example. – Thérèse Sep 16 '18 at 15:57
  • @AndréC Please download xb niloofar font from here then it should work – Ali Sep 20 '18 at 16:49
  • Yes, by installing these fonts on windows, I can compile. I don't know Persian, so I don't see what the problem is in writing words. Can you add screenshots to your question that visually explain the problem? – AndréC Sep 20 '18 at 19:33
0

Following code will solve the problem (see this link).

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\usepackage{xepersian}
\settextfont{XB Niloofar}

\newcommand{\arcarrow}[8]% inner radius, middle radius, outer radius, start angle,                 end angle, tip protusion angle, options, text
{   \pgfmathsetmacro{\rin}{#1}
    \pgfmathsetmacro{\rmid}{#2}
    \pgfmathsetmacro{\rout}{#3}
    \pgfmathsetmacro{\astart}{#4}
    \pgfmathsetmacro{\aend}{#5}
    \pgfmathsetmacro{\atip}{#6}
    \fill[#7] (\astart:\rin) arc (\astart:\aend:\rin) -- (\aend+\atip:\rmid) --     (\aend:\rout) arc (\aend:\astart:\rout) -- (\astart+\atip:\rmid) -- cycle;
    \path[decoration={text effects along path, text align=center,
        text={#8}, 
        text effects/.cd, 
        group letters,
        reverse text, 
        characters={text along path,},
        text effects={align=center},
    },
    decorate] (\astart+\atip:\rmid) arc (\astart+\atip:\aend+\atip:\rmid);
}

\begin{document}

\begin{tikzpicture}
    \fill[even odd rule,lime!30] circle (3.8) circle (3.2);
     \arcarrow{3}{3.5}{4}{0}{118}{5}{magenta,draw=red!50!black,very thick}{کاهش ارزش     آورده}
     \arcarrow{3}{3.5}{4}{120}{238}{5}{green,draw=red!50!black,very thick}{کاهش ارزش آورده}
     \arcarrow{3}{3.5}{4}{240}{358}{5}{cyan,draw=red!50!black,very thick}{کاهش ارزش آورده}
\end{tikzpicture}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.