小写字母尾部高度(g、j、p、q、y)
这个问题有点奇怪。我必须确保上面和下面字母之间的距离。现在,当计算字母高度(以像素为单位)时,假设字体大小 = 14px,这是否意味着我为字母分配的像素高度是 14 像素?带尾巴的字母怎么样?它们的尾巴在像素中是如何分配的?
------------
| ** |
| * * |
| ****** | = for example this is a 14px font size
| * * |
|* *|
------------
我的带尾部的小写字母怎么样?
------------
| |
| ****** |
| * * | = this letter q for example
| * * |
| ****** |
--------*---
*
其尾部是否有特定的高度,可以溢出字体的分配像素?
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 a font?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果我没记错的话,尾巴包含在分配的像素中。通过向仅包含字母的跨度添加边框来检查这一点:
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:
我想这很大程度上取决于您用来测量字形高度的系统。如果幸运的话,字体本身可以提供文本行高度的度量。当高度度量不可用时,一般来说(特别是对于网络技术),高度与小写“x”高度的两倍一致(小写“x”的高度称为 x 高度) 。 CSS 规范中有一节,介绍了 x-可以估计字体的高度,其中包含更多信息。
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.