CSS 属性 font-size 可以定义其“长度”(以像素为单位)。
它具体描述了什么,它是标称字符(例如,'m')的宽度(或高度),它是字体文件描述中的某个属性,还是其他东西?
我一直无法找到这条信息:我在一些接受的答案(在 stackoverflow 中)中发现的是大写字母“H”的高度,其他大写字母“I”和较低的“p”加上一些金额。
如果能提供指向实际规范的链接,我将不胜感激。顺便说一句,http://www.w3.org/TR/CSS2/fonts.html#font-size-props似乎对这方面保持沉默。
我很想知道这个指标与等宽字体字符宽度的关系。
最佳答案
This property indicates the desired height of glyphs from the font. For scalable fonts, the font-size is a scale factor applied to the EM unit of the font. (Note that certain glyphs may bleed outside their EM box.) For non-scalable fonts, the font-size is converted into absolute units and matched against the declared font-size of the font, using the same absolute coordinate space for both of the matched values.
你问:
what I have found, in some accepted answers (in stackoverflow), statements being the height of capital 'H' otherss of capital 'I' and lower 'p' plus some amount.
这取决于字体。 CSS 只能描述 em 框的所需高度,但字体作者可以在其内部或外部任意位置绘制字形。参见 here了解更多详情。
I am interested in that to know how this metrics relate to monospace typeface's character width.
只是间接的。不同的等宽字体有不同的高度和宽度比例。
关于html - 以像素为单位的 CSS 属性字体大小,它到底描述了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20799277/