The following compares several "midpoints":
1ex
(the unit name is derived from the lowercase letter x), see
David's answer.
The middle of the letter E
(method from the question).
Math axis, center axis of minus, equals, plus and others. This is also the method of egreg's tabular
solution.
Ratio of the strut box. LaTeX puts 30 % of \baselineskip
below and 70 % above the base line.
The following example file defines macros \midraiseboxA
up to \midraiseboxB
and compares them:
\documentclass{article}
\usepackage{calc}
\newcommand*{\midraiseboxA}{%
\raisebox{1ex-.5\height}%
}
\newcommand*{\midraiseboxB}{%
\raisebox{(\heightof{E}-\height)/2}%
}
\newcommand*{\midraiseboxC}{%
\raisebox{\heightof{$\vcenter{}$}-.5\height}%
}
\newcommand*{\midraiseboxD}{%
\raisebox{.2\baselineskip-.5\height}%
}
\usepackage{color}
\newcommand*{\testI}{%
\textcolor{red}{\rule{.5ex}{.25pt}}%
}
\newcommand*{\testII}{%
\rule{\baselineskip}{\baselineskip}%
}
\setlength{\parskip}{2ex}
\begin{document}
\newcommand*{\test}[1]{%
E#1{\testI}xe#1{\testI}- Test #1{\testII} Testing %
\kern-.75\baselineskip
\textcolor[gray]{.5}{%
\rlap{\raisebox{-.5\height}%
{\rule{3\baselineskip}{.2pt}}}%
\rlap{\raisebox{\heightof{E}-.5\height}%
{\rule{3\baselineskip}{.2pt}}}%
\rlap{\raisebox{\depthof{g}*(-1)-.5\height}%
{\rule{3\baselineskip}{.2pt}}}%
}%
\kern.75\baselineskip
#1{\testII} Eg%
\par
}
\test\midraiseboxA
\test\midraiseboxB
\test\midraiseboxC
\test\midraiseboxD
\end{document}

Remarks:
The dependency on package calc
can be removed if needed:
- The expression
\heightof
is calculated using \settoheight
and
- the calculations can be done with e-TeX's
\dimexpr
.
Example for \midraiseboxC
:
\newdimen\midraisedimen
\newcommand*{\midraiseboxC}{%
\settoheight\midraisedimen{$\vcenter{}$}%
\raisebox{\dimexpr\midraisedimen-.5\height\relax}%
}