The below MWE draws a number of rectangles using low-level pgf commands, each specified with a different unit that Latex understands. However, pgf doesn't seem to be able to determine the relative units ex, em and sp. Is there a reason for that?
By way of context, I was trying to declare a new shape with a size relative to the current text. As the shape isn't meant to contain any text, it seemed a better approach than making it relative to a non-existent \pgfnodeparttextbox. If pgf can't cope with relative units in this context, is there a better approach to setting the initial size of a shape?

\documentclass[a4paper]{article}
\usepackage{tikz}
\begin{document}
\newdimen\ptdim
\newdimen\pcdim
\newdimen\indim
\newdimen\bpdim
\newdimen\cmdim
\newdimen\mmdim
\newdimen\dddim
\newdimen\ccdim
\newdimen\spdim
\newdimen\exdim
\newdimen\emdim
\begin{tikzpicture}
\ptdim=12pt
\pcdim=2pc
\indim=2in
\bpdim=100bp
\cmdim=3cm
\mmdim=20mm
\dddim=40dd
\ccdim=10cc
\spdim=500sp
\exdim=5ex
\emdim=5em
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\ptdim}{\ptdim}}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\pcdim}{\pcdim}}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\indim}{\indim}}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\bpdim}{\bpdim}}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\cmdim}{\cmdim}}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\mmdim}{\mmdim}}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\dddim}{\dddim}}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\ccdim}{\ccdim}}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\spdim}{\spdim}}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\exdim}{\exdim}}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\emdim}{\emdim}}
\pgfusepath{stroke}
\node[below] at (\ptdim,0) {pt};
\node[below] at (\pcdim,0) {pc};
\node[below] at (\indim,0) {in};
\node[below] at (\bpdim,0) {bp};
\node[below] at (\cmdim,0) {cm};
\node[below] at (\mmdim,0) {mm};
\node[below] at (\dddim,0) {dd};
\node[below] at (\ccdim,0) {cc};
\node[below] at (\spdim,0) {sp};
\node[below] at (\exdim,0) {ex};
\node[below] at (\emdim,0) {em};
\end{tikzpicture}
\end{document}

spin Stefan's answer, it seems. I thought it's 65.536sp= 1pt, not 65000 ... – ThomasH Mar 27 '13 at 21:19\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{1em}{1em}}) or to use PGFMath to set the lengths (\pgfmathsetlength\emdim{1em}) because when PGF computes a length itself then it restores the current font to get such lengths right. The problem with the original post is that it doesn't use PGF's methods for setting lengths but uses TeX's methods directly and so PGF doesn't get a chance to undo the\nullfontdeclaration. – Andrew Stacey Mar 27 '13 at 22:53