Ascent 是 baseline到文字顶部空间的距离(The ascent is the amount by which the character ascends above the baseline.),实际上,文字实际绘制的像素并不会到达 Ascent,即绘制的像素离 Ascent 还有一小段空白空间
Descent 是 baseline 到文字底部空间的距离(The descent is the amount by which the character descends below the baseline.),实际上,文字实际绘制的像素并不会到达 Descent ,即绘制的像素离 Descent 还有一小段空白空间
Leading 是 Descent 到下一行文字之间保留的空间(The standard leading, or interline spacing, is the logical amount of space to be reserved between the descent of one line of text and the ascent of the next line. )
除此之外还有另外一个隐形的变量,就是 height,和 baseline,Ascent ,Descent ,Leading 之间的关系是:height = Leading + Ascent +Descent 。
那么假设 logo 图片的中心点的纵轴坐标是 Y,那么文字绘制开始的纵坐标,即 baseline = Y + (height / 2 - Leading - Descent),这样即可让 logo 图片和文字在纵坐标上居中对齐,如图: