logoalt Hacker News

graypeggtoday at 6:27 PM0 repliesview on HN

I know this is an irrelevant factoid and literally does not matter at all, but it's a tad more meta that just em = font size. Prepare to be bored:

The em unit/point size in typography was based on the height of the lead sorts you were using. [0] (A sort is basically a little lead stamp with a single letter jutting out on the front face. [1]) Its almost always larger that any dimenion of the actual character, since the sorts are just clamped together when doing the actual typesetting, so you want a gapless grid of lead to keep everything in place. [2] You couldn't have any spacing between letters/lines if the castings themselves were only as tall or wide as the character.

That meant the em height was a real physicial thing you could measure with a ruler, commonly in points, where 1/72 of an inch = 1 point. When you ordered typefaces from foundaries, you'd specify what point size you wanted, so all of your large-point headings would line up in one slug, which you'd clamp above another slug of body copy text all sized to a smaller point size. That tied an em to both the size of text, but only in the context of 1 font family. You could leave the em size the same and cast a glyph larger on the same size of sort, changing the baseline, line-height/ledding and letter-spacing/tracking. Now it doesn't line up with your other font faces with the same em size, even if they clamp together just fine.

But in modern typesetting, you don't have a physicial em-height lead block to deal with. Internally, the font uses it's own unitless values to describe both the vector shape of the glyphs, as well as units like the line height, letter spacing, and em height. It's no longer a "real" measurement you could actually measure. It's a relative one that acts like the unit value when scaling fonts. [3] If you render a font at 12pt, the text rendering scales the relative em unit until it would be 12pt or 1/6in, and then apply that scaling factor to all glyphs.

That means, digital fonts are emulating the same weird use for ems as a proxy for both the size of the glyphs AND the size of the lines/spaces between characters. If you shrink the internal em unit inside a font file, the size of glyphs increase, but so will the line height/letter spacing and other font metrics.

So... all of that together, yep the em unit is 100% dependant on the font's own settings, but it's not the font size itself. It's a sort of base-unit for everything else in the font, where 1em is defined as being a certain height in the internal font domain AND being the height of whatever the font renderer says the point size is. If you halve the em height and double the point size, you end up with exactly the same raster ouput. It also means you can't look at the screen and find any part of the letters/lines that is precisely 1em, like you could for simplier glyph-size-based unit like 1ex or 1ch. (Unless there's an em-dash... but even then, making the em-dash exactly 1em long is just convention.)

[0] https://www.thomasphinney.com/2011/03/point-size/#:~:text=ou...

[1] https://en.wikipedia.org/wiki/Sort_(typesetting)

[2] https://commons.wikimedia.org/wiki/File:Sorts_on_composing_s...

[3] https://www.thomasphinney.com/2011/03/point-size/#:~:text=Ty...