Compute the width and height of a text string.