Alex Rivera | Logout

How is font size calculated?

Asked 2010-08-16T17:57:43.247
21

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.

I have noticed that some font's sizes are different depending on the font.

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?

Edit
Report

2 Answers

8

See the spec:

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

answered 2010-08-16T18:06:26.513
2

Per the spec (http://www.w3.org/TR/CSS2/fonts.html)

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

answered 2010-08-16T18:08:53.780

Your Answer