2.3.1 Determining Character Widths

The values in the extent table are the widths of the characters when the font height equals etmMasterHeight. When the font height does not equal etmMasterHeight, the driver must scale the values from the extent table. Always assume linear scaling fonts.

The values in the extent table are in font units. The width of a character for a particular font height may be computed as follows:

character width value out of extent table in font units

——————————————— = ———————————————————————————————————————

fontheight etmMasterUnits font units

By multiplying font height through the equation, we have the formula for computing character width:

font height * value out of extent table in font units

character width = ———————————————————— —————————————————————————————————

etmMasterUnits font units

Character width takes on the units of font height. If the font height is in device units, the resulting width will be in device units. If the font height is in font units, the resulting width will be in font units.

In its normal mode of operation, the driver simply plugs the font height into the above equation to compute the character width. Font height is normally in device units, so the resulting width is normally in device units.

For example, assume the device resolution is 300 dpi and the font units are expressed as 1000 units-per-em. Assuming that the etmMasterHeight member represents a 72-point font, the values would look like this:

dfVertRes = 300

etmMasterHeight = 300

etmMasterUnits = 1000

Additionally, assume the value in the width table for a capital H is 500 font units, or half the em height. Assume the height of the font for which you want the character width is 12 points, or 50 device units. With relative widths disabled, the character width would be computed using the first width formula:

50 device units * 500 font units

———————————————————————————————— = 25 device units

1000 font units