Does anyone have any idea why there are be few extra pixels on the
top? The black box represents the center with height equal to
heightForStringDrawing().
This caught me too a while back. The answer is it's because NSString
drawing uses the Jaguar-style typesetter behavior, I'm guessing for
backward compatibility reasons. If you switch the layout manager to
use the Jaguar "with compatibility" typesetter behavior, then that
ought to fix the problem.