Microsoft KB Archive/57477

DAT File Format Specifications for Word 5.00

PSS ID Number: Q57477 Article last modified on 11-02-1994

5.00

MS-DOS

= SUMMARY =

The first two bytes of the DAT file contain 0x0500 to indicate the Word version number. This feature is new as of Word version 5.00. Word has code to issue a warning, and to continue if you want to, if the version number is not detected at the front of the DAT file.

Word 5.00 provides the choice of downloading all fonts or only those that have been added to the document since the most recent printing. If you choose to download all fonts, the initializing sequence is sent (usually deleting all temporary fonts from the printer’s memory), followed by the first printer control sequence for a given font, the downloadable font itself, the third printer control sequence for the font, and the ending sequence.

Note that the middle three steps are duplicated for each font being downloaded. If you choose to download only new fonts, only the first printer control sequence for the font, the downloadable font itself, and the third printer control sequence are sent for each new font being downloaded.

The escape/control codes used to download fonts should always download all fonts as temporary fonts, rather than permanent fonts, and the escape/control codes sent at the beginning of every document (stored at byte:0 in the Printer Control Description Table of a PRD file) should not be reset or erased.

The next two bytes of the file indicate the following:

. Count of number of downloadable fonts (binary) – 1 byte. . Data type (download routine to use – binary) – 1 byte. 0 Means only one escape sequence is used for each font. 1 PostScript downloadable fonts. New for Word 5.00. 2 Means three escape sequences are used for each font (the middle one being the font filename; see below).

The following are initialize and ending download commands:

. Length byte (binary) – 1 byte. . Initializing sequence (nothing here if length byte = 0) (for example, *c1F for the LaserJet to delete all temporary soft fonts).

. Length byte (binary) – 1 byte. . Ending sequence (nothing here if length byte = 0): Codes to be sent at the end of the downloading process.

This is followed by information about the fonts to be downloaded:

unsigned fontno Font number – 1 byte. (This is the Word font ID number as stored in the PRD file.)

hps Half point size – 1 byte.

unsigned cch Length of first Printer Control Sequence (PCS) – 1 byte.

char *pszPCS First PCS (If data type = 0, this is the only escape sequence.)

unsigned cch1 Length of second PCS – 1 byte.

char *pszPCS1 Second PCS (this is the font filename).

unsigned cch2 Length of third PCS – 1 byte.

char *pszPCS2 Third PCS.

The last group of information is the Font Download Description. It is repeated for every downloadable font. The file length is dependent upon the number of individual downloadable fonts available for the printer in question.

Note: For the HP LaserJet, the first and third escape sequences for each font contain a unique ID number (different from the Word font number), which is preceded by the sequence &quot;Escape*c&quot;.

Note: For filetype = 1 (PostScript download fonts), only the second sequence should be used to indicate the font filename; the first and third sequences contain PostScript commands required to process and create the font correctly. Also, each font size requires only one entry because PostScript fonts are scalable. The font size indicated in the DAT file should be zero.

KBCategory: kbprint KBSubcategory: Additional reference words: ============================================================================= Copyright Microsoft Corporation 1994.