gpt4 book ai didi

css - 什么是字体的 "EM box/EM unit",它在哪里定义

转载 作者:行者123 更新时间:2023-11-28 08:36:58 27 4
gpt4 key购买 nike

CSS3 CSS Fonts Module Level 3 (candidate Oct 13) , 在第 2.3 节中有一个对“EM 盒”的引用和一个对“EM 单元”的引用。引用如下:

[The font-size] 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.

什么是“EM 箱”或相关的“EM 单元”?

浏览器(和其他用户代理)应该从某个地方、从哪里获取它?

最佳答案

在传统排版中,大写字母 M 及其周围的强制空白所占用的空间始终是一个正方形。正方形的高度或宽度,即“em”,用作文本使用的空间单位。例如,根据该定义,一个 em 是包含上行和下行空格但没有任何额外的行间距的文本行的高度。

em 的实际大小(如果您谈论的是纸张)或像素(如果您谈论的是计算机)取决于您选择的字体和字体大小。

浏览器等从字体中获取此信息,字体有一个表格,提供此类常量,它们可用于指导文本呈现。

关于css - 什么是字体的 "EM box/EM unit",它在哪里定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20845711/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com