I want to draw \rhd with Tikz. To do this, I get the height and width of \rhd and then use those as x and y in Tikz. I expected this to make Tikz draw exactly \rhd but it draw a larger version of it and I do not understand why.
\documentclass{article}
\usepackage{amssymb}
\usepackage{calc}
\usepackage{tikz}
\begin{document}
\newlength{\testwidth}
\newlength{\testheight}
\newsavebox{\testbox}
\savebox{\testbox}{$\mathsurround=0pt\rhd$}%
\settowidth{\testwidth}{\usebox{\testbox}}%
\settototalheight{\testheight}{\usebox{\testbox}}%
\pgfmathsetlength{\testheight}{\testheight / 2}%
\begin{tikzpicture}[x=\the\testwidth, y=\the\testheight]
\draw (0,1) -- (1, 0) -- (0, -1) -- (0, 1);
\end{tikzpicture}
$\rhd$
\end{document}

\wd\testboxfor the width. This is how\settowidthetc actually get the width. OTOH, the total height is{\dimexpr \ht\testbox+\dp\testbox}. – John Kormylo Feb 27 '20 at 16:18