![]() |
Screen Dots per Inch
To scale a font you simply change the screen dpi using the Windows Control Panel, but doing so using a high dpi value, such as “Large Fonts” at 120 dpi, can make a mess of what you see on screen as other window elements may not scale proportionally. It’s easy to assume that because programs allow you to specify font sizes in points that this is what Windows uses internally. Wrong! Windows, as far as fonts on screen are concerned, doesn’t use points at all - but pixels. When a program requests a specific screen font size then Windows wants that font size in pixels and when you specify a font size in points the program will convert that font size to pixels using the equation I’ve given earlier. A program author can, of course, take complete control of font sizing by specifying screen font size directly in pixels and ignoring the screen dpi setting. Screen InchesI’ve been talking about how screen dpi maps font size measured in inches to pixels on screen, but Screen dpi is used to map inches into screen pixels irrespective of whether we are dealing with font inches or just length measurements. It’s how a browser translates an inch specified in CSS into a number of pixels on screen. See The CSS Inch When a program draws a line one inch long on a piece of paper then your ruler will tell you it is indeed one inch long. The computer knows the physical size of the paper drawing surface. When a program draws a line one inch long on a screen your ruler will tell you that it is not one inch long. The computer does not know, reliably or accurately, the physical size of the screen drawing surface. What the computer does know is the size of the drawing surface in pixels. Ruler inches on a piece of paper make sense because anything drawn on paper is measured in ruler inches. Ruler inches on a screen don’t make sense because anything drawn on a screen is measured in pixels. When a screen distance is specified in inches then those ruler inches are mapped to screen pixels by multiplying the number of inches by the screen dpi value, and the distance occupied by those pixels is called a ‘logical inch’. Logical InchesA logical inch is not the same as a physical inch and is a difficult concept to grasp. When I described the concept of the logical inch in a newsgroup thread Font Size in Dreamweaver vs CSS one contributor believed I was attempting to redefine scientific laws. A physical inch doesn’t change its size - a logical inch does. If the screen is set, via the Control Panel, at 96 dpi, then the distance occupied by 96 pixels is one logical inch. If the screen is set at 150 dpi then the distance occupied by 150 pixels is one logical inch. If you change your video resolution, or change to a different size monitor, the logical inch is still one logical inch even though the physical distance occupied by a logical inch changes. Logical inches are elastic - physical inches aren’t. An example of the logical/physical inch confusion is where you see a web site that displays a graphic 96 pixels wide and they tell you the graphic is one inch wide, by which they mean one physical inch. Time and again one see sources falling into the trap of equating logical inches with physical inches.
I said earlier that logical inches are elastic so, for elastic inches, you need an elastic ruler and Microsoft have obliged. In the Windows Control Panel there is a display for ‘Custom DPI Setting’ where you can change the value of screen dpi and, hence, change the pixel size of text in things like menus, status bars, and titles. Grab the displayed elastic ruler with the mouse and stretch it to change screen dpi. You can stretch a logical inch, but not a physical one.
The legend says “10 point Arial at 96 pixels per inch”. They are actually demonstrating what that font and point size look like when translated to pixels using the Equation at the top of this page. The ‘ruler’ gives the impression that the divisions are physical inches - but they are actually logical inches. They talk about DPI, i.e. dots per inch - and then call it pixels per inch, thus confusing it with ppi which is something quite different, and imply they are using physical inches - which they aren’t. Whoever constructed this panel should have used the term ‘pixels per logical inch’ (ppli) and stuck with that. |
| © 2006 Richard Mason |