开发者

Lowercase letters tail height (g, j, p, q, y)

This question is a little bit odd. I have to make sure of the distance between letters above and below. Now when calculating a letter height in Pixel, say font size = 14px does this mean my alloted pixel height for a letter is 14 pixels? What about the letters with tail? How are their tails alloted in Pixels?

------------
|    **    |
|   *  *   |
|  ******  |   = for example this is a 14px font size
| *      * |
|*        *|
------------

What about my lower case letters with tail

------------
|          |
|  ******  |
| *     *  |  = this letter q for example
| *     *  |
|  ******  |
--------*---
        * 

Is there a specific height for its tail that overflows the alloted pixel for 开发者_如何学Pythona font?


the tail is included in the allotted pixels if I remember correctly. Check this with adding a border to a span with just a letter:

<span style="border: 1px solid #f00">q</span>


I would imagine that it depends largely on the system you are using to measure the height of the glyphs. If you're lucky, the font itself provides metrics for the height of a line of text. When height metrics are not available, generally speaking (and particularly with web technologies) the height is made consistent with that of twice the height of a lowercase "x" (the height of the lowercase "x" is known as the x-height). There's a section in the CSS specification on how the x-height of a font can be estimated that has more information.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜