INF: WYSIWYG Display of Text on Screen and on Printer

ID Number: Q74889

3.00

WINDOWS

Summary:

To create a WYSIWYG (what you see is what you get) display on the

screen and have this translate to a printer, the screen font must

match the printer font rather closely. This article discusses the

requirements for the screen font.

More Information:

In general, the physical font for the printer will be different from

the physical font for the screen because of differences in device

resolution. (This is provided by the LOGPIXELSX and LOGPIXELSY values,

which are also known as dpiX and dpiY.) However, it is possible to

create both a higher-resolution and lower-resolution version of a

given type face for a specified point size.

To achieve WYSIWYG, as far as the printed page and screen layout are

concerned, the following relationship must be true for all characters

on a per-character basis in the two respective fonts:

(printer resolution, X direction) (character width on printer)

--------------------------------- = ----------------------------

(screen resolution, X direction) (character width on screen)

And likewise for the height:

(printer resolution, Y direction) (character height on printer)

--------------------------------- = -----------------------------

(screen resolution, Y direction) (character height on screen)

Note, however, that these resolution ratios are usually not integers.

As a result, there will be rounding errors for character widths and

font height. It is necessary to distribute the width error such that

the average widths match the ratio of resolutions in X as closely as

possible for a wide range of different strings. This will ensure that

text line layout on the screen (line breaks) will match layout on the

printer.

A rounding error with respect to font height and the Y resolution

ratios can be avoided only in a few cases. This would constrain the

selection of point sizes for such a set of fonts. Several methods have

been developed to deal with this constraint.