5.5.2 Adding Fonts

Developers can gain access to an advanced Add Fonts dialog box by holding down the CTRL and SHIFT keys when choosing the Add Fonts button. This dialog box gives developers the following options:

The ability to specify the path from which the installer should read fonts.

The ability to rename the FINSTALL.DIR file.

The ability to indicate if an error file should be written and specify its name.

The first option is available to users through the normal Add fonts dialog box. The other two options are intended to be used by font vendors or advanced users setting up FINSTALL.DIR files for distribution.

Before parsing the FINSTALL.DIR file, the installer will report the screen aspect ratio. The installer will classify the screen type as either EGA(4:3) or VGA(1:1). It uses the same algorithm to classify the screen fonts listed in the FINSTALL.DIR file. The fonts that match the category in which the screen was classified would be loaded by the installer.

The formula the installer uses to classify screens is as follows:

Compute the screen width in lines-per-inch (horizontal resolution divided by horizontal size converted from millimeters to inches):

width = (GetDeviceCaps(HORZ_RES) * 25) / (GetDeviceCaps(HORZSIZE))

Compute the screen height in lines-per-inch (vertical resolution divided by vertical size converted from millimeters to inches):

height = (GetDeviceCaps(VERT_RES) * 25) / (GetDeviceCaps(VERTSIZE))

Take the inverse ratio of width to height:

ratio = (height * 10000) / width

Categorize the screen type based upon the ratio:

6250 to 9374 EGA (4:3)
9375 and above VGA (1:1)

It is highly recommended that font vendors use the advanced Add Fonts dialog box to verify that there are no syntax errors in the FINSTALL.DIR file. If the installer finds errors in the FINSTALL.DIR file, it will write error messages in the FINSTALL.ERR file. The messages will be of the form:

line line-number, near character character position : error message

The installer also displays a message indicating that errors were found and written to the file.