\settodepth{\gnat}{text}
The \settodepth command sets the value of a length command equal to the depth of the text argument.
\settodepth
length
text