Only calculate maxLines if it there is a valid fonthandle.