# How to align middle-align text in a parbox?

I am trying to add a frame around a text which would be centered and vertically aligned to the middle of the box but I can only center the text.

What should I do to align the text to the middle of the box?

\documentclass[12pt,a4paper,oneside]{letter}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}

\begin{document}

\noindent\fbox{\parbox{\linewidth\fboxrule\fboxsep}{\center\textbf{my text here}}}

\end{document}
-
I am not sure I understand the question \fbox{{\parbox{.5\linewidth}{\centering\rule{1cm}{2cm}}}} looks vertically aligned to me. Did you take into account the y descender of the my text here in asserting the vertical centering? –  jfbu Dec 2 '12 at 22:40
It depends on what you type, I had something else written in it and it was not vertically centered. There was more space at the top of it. –  esmitex Dec 3 '12 at 0:22

Does this do what you want?

\documentclass[12pt,a4paper,oneside]{letter}
\usepackage{calc}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}

\begin{document}

\fbox{\begin{minipage}[t][4in][c]{\linewidth-2\fboxrule-2\fboxsep}
\centering\textbf{my text here}
\end{minipage}}

\end{document}

-
Almost, I had to take off the "-2" because it would write "-2 -2" before my text. –  esmitex Dec 2 '12 at 21:34
Did you use the calc package? That might be why -2 showed up. –  A.Ellett Dec 2 '12 at 21:41
No, I didn't. I will try with it. –  esmitex Dec 3 '12 at 0:20