小写字母尾部高度(g、j、p、q、y)

发布于 2024-09-14 07:58:24 字数 490 浏览 4 评论 0原文

这个问题有点奇怪。我必须确保上面和下面字母之间的距离。现在,当计算字母高度(以像素为单位)时,假设字体大小 = 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

倾城°AllureLove 2024-09-21 07:58:24

如果我没记错的话,尾巴包含在分配的像素中。通过向仅包含字母的跨度添加边框来检查这一点:

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

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>
是你 2024-09-21 07:58:24

我想这很大程度上取决于您用来测量字形高度的系统。如果幸运的话,字体本身可以提供文本行高度的度量。当高度度量不可用时,一般来说(特别是对于网络技术),高度与小写“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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文