The \widthofstring command returns the dimensions of the given text.
For example:
width=\widthofstring{§}