How to vertically align headers/footers in fancyhdr package?

I'm using fancyhdrpackage for headings and footers. I have defined left-header as a big image, and I want to vertically align (to the top or to the center, the default is to the bottom) the text from the right-header. How can I do that?

\usepackage{fancyhdr}
\pagestyle{fancy}

\rhead{I want to vertically align THIS text}

-

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{fancyhdr}
\pagestyle{fancy}

\rhead{I want to vertically align THIS text}

\begin{document}
abc
\end{document}


And don't ignore the warning of fancyhdr:

Package Fancyhdr Warning: \headheight is too small (12.0pt):
Make it at least 59.75078pt.


Use \headheight=22mm or something like this.

-
Nice idea... but unfortunately it doesn't work correctly. As I understand, I should use -1 for top-aligned, and -0.5 for center-aligned. Well, the raisebox seems to be off by 1em. (and sorry for the LONG delay before testing this) –  Denilson Sá Oct 1 '10 at 22:18
Well it does work for me, I tested it. So something is different on your side: Either you changed the code or the graphic (which I don't have) inserts some border. Also I don't know what you mean by "off by 1em". "Off" relative to what? –  Ulrike Fischer Oct 11 '10 at 11:31

I think the problem is that in fancyhdr there is no easy way to communicate the width of a box in the left header to the right header. You could allocate a dimen register, place the width of the box in the left header into it, and use it in the right header, but I think much easier solution is to just place everything into the same header:

\lhead{\hbox to \hsize{%
\hbox{\vtop{\vskip 0pt \hbox{\includegraphics[height=21mm]{some-fancy-logo.pdf}}}}%
\hfill\hbox{\vtop{\vskip 0pt \hbox{I want to vertically align THIS text}}}}}


You probably don't even need fancyhdr.

-
Geez... What does all of that mean? Care to add a small description of what's going on there, in plain English? –  Denilson Sá Aug 28 '10 at 4:55
Rather that trying to explain it clumsily myself, I will point you yo an excellent explanation by Victor Eijkhout in his TeX by Topics, at eijkhout.net/texbytopic/texbytopic.html. You want to look at the chapter on Boxes. –  Jan Hlavacek Aug 28 '10 at 14:45

I got a solution. It's a very ugly hack, but it works in my case (because I know in advance the height of the header).

\rhead{\parbox[b][21mm][t]{0.5\textwidth}{\raggedleft I want to vertically align THIS text}}


I'm accepting better solutions. :)

-