2.3 Font Scaling: etmMasterHeight and etmMasterUnits

Printer drivers use the values in the etmMasterHeight and etmMasterUnits members of the EXTTEXTMETRIC structure to scale the character width values in the extent table. A driver allows two methods for measuring character widths:

Device units or “pixels”

Font units

Device units are the number of dots in the physical device (dots-per-inch); etmMasterHeight is expressed in device units. It may be converted to points using the formula:

etmMasterHeight device units * 72 points-per-inch

height in points = ——————————————————————— ——————————————————————————

dfVertRes device units-per-inch

In this case, 72 represents the number of points-per-inch. The dfVertRes member contains the number of dots-per-inch in device units.

Font units may differ from device units as a convenience to the font vendor. If the font is intended for devices that differ in resolution, there typically is no benefit from mapping the resolution of the font to the resolution of a particular printer. The vendor uses the units that are most convenient for designing the font. For example, 1000 units-per-cell (or em) is the Adobe standard for PostScript fonts; etmMasterUnits is expressed in font units-per-em where an em equals etmMasterHeight.

A number may be converted from device units to font units using the formula:

value in device units * etmMasterUnits font units

value in font units = ———————————————————————— —————————————————————————

etmMasterHeight device units

The formula for the inverse operation is:

value in font units * etmMasterHeight device units

value in device units = —————————————————————— ————————————————————————————

etmMasterUnits font units