I'm trying to place arrow shapes above certain letters in a text. I tried compensating for the extra space of the tikzpicture in mid-word, using execute at begin picture and its end pair.
The results aren't very good, is there a better way of doing this?

\documentclass{minimal}
\makeatletter
\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{TeX Gyre Pagella}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{shapes.arrows}
\newcommand\toneUp[1]{%
\def\mychar{#1}%
\begin{tikzpicture}[
execute at begin picture={
\pgfmathparse{0.5*(1.6mm-\widthof{\mychar})}
\hspace*{-\pgfmathresult mm}
},
execute at end picture={
\pgfmathparse{0.5*(1.6mm-\widthof{\mychar})}
\hspace*{-\pgfmathresult mm}
}]
\node[inner sep=0pt, outer sep=0pt] (mychar) {\mychar};
\node[single arrow, minimum height=5mm, minimum width=7mm, single arrow head extend=3mm, single arrow head indent=1mm, scale=0.3, red, fill=red, rotate=90, above=0.3mm of mychar.north, anchor=west] {};
\end{tikzpicture}
}
\setlength{\parindent}{0pt}
\makeatother
\begin{document}
ārop\toneUp{i}tehi\\
paṇṇ\toneUp{ā}kār\toneUp{a}\\
bh\toneUp{ū}te
\end{document}


%, you need\end{tikzpicture}%. I can't help with the tikz, but probably I would set the character normally, ie just start (or end) your macro with#1and then use a zero-sized tikzpicture to overlay the arrow. – David Carlisle Sep 8 '12 at 9:57