如何计算字体大小? [英] How is font size calculated?

查看:192
本文介绍了如何计算字体大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个复杂的js函数与一个方程,其中我实际上需要了解以像素字体大小占用多少空间。

I have a complex js function with an equation in which I actually need to understand how much space in pixels font sizes take up.

我注意到一些字体

如何计算字体大小?如果它设置为 12px ,在css中, 12px 是什么意思?是 12px 宽吗?高?或者是对角像素测量?

How is a font's size calculated? If its set to 12px, in css, what does the 12px mean? Is that 12px wide? High? Or is it a diagonal pixel measurement?

推荐答案

请参阅 spec


字体大小对应于em
方块,这是在排版中使用的概念。

请注意,某些字形可能会在其正方形之外出现

The font size corresponds to the em square, a concept used in typography.
Note that certain glyphs may bleed outside their em squares.

这篇关于如何计算字体大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆