Font Size

Font Size

As explained in Screen Dots Per Inch one gets the font size in pixels by multiplying the font size in inches by the screen dpi. This calculated font size, the font name, and a whole raft of other parameters, are passed to the Windows Application Programming Interface (API ) which then instantiates the font so that the font driver can actually create it. Windows functions that create screen fonts require the requested font size to be in pixels, not points , so every application that allows you to choose a screen font size in points has to convert that point size to pixels, using the screen dpi value, before requesting the API to create the font. A program can, however, bypass this calculation by allowing screen font size to be directly specified in pixels and screen dpi is then ignored because a points to pixels conversion is not required. Firefox is one program that allows font sizes to be specified in pixels, and uses 16px as the default value.

Let’s have a look at some basic Windows font terms.

  • Font height = Ascent + Descent.
  • Font size = Font Height - Internal Leading.

Internal leading, pronounced ‘ledding’, is the space for diacritics (accent marks).

Arial 12pt at 96 dpi:

                      font size in points             12
font size in pixels = ------------------- × 96 dpi = ---- × 96 = 16 pixels
72 points per inch 72

The font name and requested font size (in pixels) is passed to the API . After the font is created its actual parameters can be obtained from, you guessed it, the API and this says that for Arial with a font size of 16 pixels:

ascent = 15 pixels,  descent = 3 pixels,  internal leading = 2 pixels
font height = ascent + descent = 15 + 3 = 18 pixels
font size = font height - internal leading = 18 - 2 = 16 pixels

Arial 48pt at 110 dpi:

                       48
font size in pixels = ---- × 110 = 73 pixels
72

ascent = 66 pixels,  descent = 16 pixels,  internal leading = 9 pixels
font height = 66 + 16 = 82 pixels
font size = 82 - 9 = 73 pixels

  • Font size is made up of three components i.e. ascent, descent, and internal leading and these components can vary widely for different fonts having the same font size

Let’s compare two quite different fonts having exactly the same font size i.e. Scriptina 48pt at 96 dpi and Arial 48pt at 96dpi.

                       48
font size in pixels = ---- × 96 = 64 pixels
72

Font size and font height are not the same thing . The font size of these fonts are identical at 64 pixels but the height of the 48 point Scriptina is 188 pixels, while that of the 48 point Arial is 72 pixels.

你可能感兴趣的:(windows,application,Parameters,fonts,Components,diacritics)