# Vertically centering two separate paragraphs, why these spaces are not equal?

\documentclass[12pt]{article}
\usepackage{fontspec}
\topskip0pt
\begin{document}
foo

\vspace*{\fill}

bar

\vspace*{\fill}
\end{document}


Second vertical space is smaller then first. Why? How to do equal spaces?

The first vertical space is smaller, equal or greater than the second depending where you measure.

Adding \showoutput you see

First is

....\glue 0.0 plus 1.0fill
....\glue 0.0
....\glue(\parskip) 0.0 plus 1.0
....\glue(\baselineskip) 6.05202


as the glue stretch order is fill this means that the second and third glue don't contribute so there is exactly fill glue to the (invisible) notional position above barthen the 6pt required (due to the height ofb) to position bar one baselineskip below that point.

second is

....\glue 0.0 plus 1.0fill
....\glue 0.0
....\glue 0.0 plus 1.0fil
....\glue 0.0
....\glue 0.0 plus 0.0001fil
...\glue(\baselineskip) 22.02


which is similar 2nd, 3rd, 4th glue do not contribute anything so there is exactly 1fill glue to the bottom of the main text box (where showframe drew the rule) then (note ... showing one less box level) there is 22pt space down to the page number.

So in other words the first vertical space would be same as second if instead of measuring to the top of the b that is actually there you measured to the notional point where a big symbol like ( would be.

You could use

\nointerlineskip
bar
`

But then the position of the text would depend on the characters in teh word which isn't normally what is wanted.