Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

I have a 40 pixel font that I'm trying to translate into custom images. I'm trying to match the size of the image exactly, but I'm having some problems getting exactly the right size. Basically, what it comes down to is this. When a font says it is X pixels, what does this physically mean?

share|improve this question
    
in font we have a terminology of x height, are you talking about the same?? –  Jack Oct 8 '11 at 5:09
1  
If you are typing a document, a font size 12 is typically used. What does the 12 mean? –  PearsonArtPhoto Oct 8 '11 at 13:45
    
12 = 12pt type (typically) –  DA01 Oct 11 '11 at 0:17
    
have a look at w3.org/Style/Examples/007/units.en.html#font-size –  Jack Oct 11 '11 at 4:57

5 Answers 5

up vote 16 down vote accepted

This is an excellent question, which has a rather unsatisfactory answer.

The size of type, whether specified in pixels, points (1/72") or millimetres, is the height of an em-square, an invisible box which is typically a bit larger than the distance from the tallest ascender to the lowest descender.

Given this is a somewhat arbitrary measure which

  • is dependent on the exact technical design of the font
  • can't be precisely measured from a printed or rasterized sample

it's not very meaningful or useful, other than as an approximation.

In your case, work out what size you need to specify in Photoshop to match the browser's rendering by experimentation. You should find this to be a constant ratio for any font, but I wouldn't expect this to be the case if you change browser or OS.

share|improve this answer
1  
this is the most accurate answer of the bunch and should be the accepted one. (IMHO) –  DA01 Oct 10 '11 at 20:13

Try typing in the vertical bar character ('|') and measure that. If I duplicated your situation correctly and your antialiasing isn't blurring it too much, it should be 22px.

22px represents the height of the block of type. But each character fills the block differently. A 'g' or 'q' will occupy the lower region of that 22px, while capital letters and lowercase letters like 'b' or 'd' will occupy the upper portions. '|' is one of the only (if not the only) character that will entirely fill the 22px space.

I don't know about how to compare to your CSS settings, but that explains how Photoshop interprets text height.

share|improve this answer
1  
Furthermore, you can set two fonts at the same size and you'll often see that the letterforms, themselves, are not. They simply have the same 'block' size. –  DA01 Aug 10 '12 at 21:20
    
Interesting point about the vertical bar character, does that always fill the whole height? –  e100 Aug 14 '12 at 17:09
    
Not sure. I suppose it wouldn't -have- to, but doing so might be an accepted convention among typographers. –  Brendan Aug 14 '12 at 17:51
2  
The pipe does not always fill the total space allotted. It's purely a preference by the type designer. It'll often match the top of the ascenders and bottom of the descenders, but even then, the space allotted for the characters can still be much larger. –  DA01 Aug 14 '12 at 18:36
2  
The vertical bar character is not always equal to the em size (eg "full height") of the font, no. In fact, usually it will be less. –  thomasrutter Aug 15 '12 at 11:38

The "font size" of a font refers to the font's "em height", not to the height of the actual characters in that font.

So, if you set your font size to, say, 22 pixels, then a letter in that font won't be 22 pixels tall, it'll usually be quite a bit less than that.

The "em height" of a font is actually an arbitrary choice made by the font designer these days. In old days when type consisted of metal blocks, the "em height" was the height of one of those blocks, which needed to be high enough not only for any character in that typeface but also for any ascenders, descenders, and accents.

Thus, usually the em size of a font adheres to the same basic idea - it'll be roughly set to the distance from the lowest descender or accent (such as the bottom of the letter g) to the highest ascender (such as the top of the letter h) with a little to spare. Modern typefaces usually include accents on capital letters too (such as Ć) - these usually aren't considered part of a font's typographical ascender for historical reasons, but it's not like there's a font police.

So, a digital type designer, having no physical limitations (it's possible for digital fonts to extend outside the em square), is free to ignore any and all conventions and pick any foundation for their em size. This means that for different fonts, setting the same font size of "22 pixels" will possibly result in different sized actual letters.

And, even if the designer does choose a certain convention, such as typographical descender-to-ascender, for their em size, this doesn't tell you the size of capital letters (cap-height) or the size of say an o (x-height) as these can vary freely between typefaces in relation to the ascender height.

Within a font family, these will usually be consistent though. So for example, Times New Roman Bold and Times New Roman Regular will have the same character sizes for the same em size, which should include ascenders, descenders, cap-height and x-height.

share|improve this answer
    
Thanks for this very good explanation. Very helpful to understand that basically font size is an arbitrary measurement. –  znq Nov 1 '12 at 9:52
1  
Yes - there are conventions (such as em being from bottom of 'g' to top of 'h') but there is still variance, and font formats do not hold designers to these conventions at all. –  thomasrutter Nov 2 '12 at 7:36

ASCII Time! Pretend the two boxes below are pieces of lead type from 1900 or so. Back then, typefaces were cast in lead (or routed in wood). For the type to be set into a printing lock-up, they had to be connected to solid blocks. This is where the dimension of the type (in points) comes from:

+-------------+ +-------------+ +-----+
|             | |             |       |
|    xxx      | |             |       |
|    x xx     | |             |       |
|   xx  xx    | |             |       +
|   x    x    | |     x       |
|   xxxxxxx   | |    x x      |   Point size of the type
|   x     x   | |    xxx      |
|  xx     x   | |   x   x     |       +
| xx      xx  | |   x   x     |       |
| xx      xx  | |             |       |
|             | |             |       |
+-------------+ +-------------+ +-----+

Note the two letters above are different sizes, but their bounding box is the same. As such, in terms of points, both of those fonts are the same size.

Nowadays, we don't make much type in lead and wood and most of it is digital. However, the concept of the point sizing still exists in that there is a virtual box that is the same height for every letter that the type is placed on. Again, it's this virtual box that defines the point size rather than the physical measurements of the letterforms themselves. The actual size of the letterforms are often smaller than the point size (but can also be larger as well).

Measuring type in pixels doesn't work because of that, however, you can 'set' type in pixels in CSS and the like. The browser does a translation as best it can between the px size declared. But it's always a fuzzy estimation.

Ultimately, there's no accurate way to get two typefaces letterforms exactly the same size short of looking at them visually and changing the size of each until you see them as being the same size.

share|improve this answer
    
In your computer you calculate Points to Pixels like this PX = Points * SystemDPI / 72. DPI in a video world (monitor) is a pure arbitrary value introduced by Apple in 1984. Video devices use only pixels; DPI doesn't exist in video/image world. Modern fonts is based on this concept where 1 point, 1/72 is defined as 1/72 of an inch. –  0x2bad 0xdeadbeef Nov 1 '12 at 21:37
2  
@AbdiasSoftware Yes, 1 point has been averaged to 1/72 of an inch and the first Mac had a 72 ppi screen. But not sure what that has to do with the question asked or the answer I gave. The fact remains that fonts, be them digital or analog, have a bounding box and that bounding box is what the size is referring to. –  DA01 Nov 1 '12 at 21:51

Are you sure your font is measured in pixels? Most of the time fonts are measured in points. A point is 1/72 of an inch. So a 40 pt font is 40/72" or 5/9" tall. The kicker is that that is the dimension from the top of the ascenders on tall letters to the bottom of the descenders on letters that hang below the baseline. That's why the x-height is sometimes used, as mentioned above. That is the height of the lower-case letters that don't stick up or down.

Either way, the measurements are never exact anyway, unfortunately. You'll just have to some measuring and figuring (and/or trial-and-error) to accomplish what you're trying.

share|improve this answer
1  
I'm not really sure about anything, but this answer makes sense. Thanks! –  PearsonArtPhoto Oct 9 '11 at 4:03
    
But points are only relevant to physical type (printed, carved, engraved etc). –  e100 Oct 10 '11 at 11:38
    
Not entirely correct. Type isn't measured from top of the ascenders to the bottom of the descenders, but rather it's measured by a bounding box that may or may not correlate to the ascender/descender height. This goes back to the days of lead and wood type where type was put on a block. It was the height of this block that dictated what size the type was labeled as. As such, two fonts, both set at 12pt may be very different sizes compared to each other. (I won't get into that fact that 1pt doesn't traditionally = 1/72 of an inch... ;) –  DA01 Oct 10 '11 at 19:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.