He was reading the prayer leaf (embroidered by Lorna Bucket) which was inside the cot. If you watch, the Doctor is looking into the cot but Amy and Rory (and the camera) look at the writing on the side. The prayer leaf told the Doctor who River was in exactly the same way it then told Amy and Rory.
We don't know what the Gallifreyan writing said. River didn't translate it and the TARDIS won't. It's possible, of course, that since it was the Doctor's cot, it was his name on the side.