In order to avoid misalignment issues with tikz nodes I have decided to set the options text height and text depth so that all nodes have the same height and depth as a normal line of text. According to Wikipedia, the standard height of a line of text is .7\baselineskip and the standard depth .3\baselineskip. Therefore I do
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node[draw,text height=.7\baselineskip,text depth=.3\baselineskip] at (0,0) {x};
\end{tikzpicture}
\end{document}
But this means I have to remember these values.
Is there a command that would compute the height and depth of box that I can use in these circumstances? E.g. text depth=\depthof\strut.
Note:
This question is very similar to How to fix TikZ node's height with \heightof?. However the solution given there involving the calc package no longer seems to work.

calcprovides these commands:\widthof{text},\heightof{text},\depthof{text}, and\totalheightof{text}(sum of height and depth). Could this be what you are looking for? – Andreas Oct 12 '17 at 17:48