Screen Dots per Inch

  • Most applications specify font sizes in points. There are 72 points per physical inch so point font sizes are actually specified in inches you measure with a ruler.
  • Font sizes in inches are fine on a piece of paper but meaningless on a PC screen where the size of anything is measured in pixels.
  • Problem: How to translate font size in inches for paper to font size in pixels for a screen.
  • Solution: Define a multiplying factor, let’s call this ‘K’, such that when you multiply the font size in inches by this factor the result is font size in pixels.
  • font size in pixels =  font size in inches × K
  • Windows allows you to change the value of ‘K’ in the Control Panel.
  • Instead of calling the multiplying factor ‘K’ call it ‘screen dpi’ so:
  • font size in pixels =  font size in inches × screen dpi

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 Inches

I’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 Inches

A 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.

“ The computer monitor ... typically works at a measly 72 or 96dpi depending on the monitor size and the total number of pixels on being displayed on screen ”

— Web graphics book

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.

96 pixels wide image demonstrating it is not one inch wide at 96 dots per inchOn a screen set at 96 dpi this image is one logical inch wide. It is not one physical inch wide. Change your video resolution, or monitor size, and the physical distance occupied by the image will change, but the image will still be 96 pixels wide and one logical inch wide. If someone recommends that you adjust your screen dpi so that the logical inch matches a physical inch, just because they think you should, then ignore them. The computer screen is not a piece of paper and is not read at the same distance or orientation as print on paper.

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.

Windows Custom dpi Panel

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.