˂  J _ BlBrA _  J _A WORDPERFECT ??/92   _  J _A  j WORDPERFECT ??/92 ˿WordPerfect 5.1 Document Format WordPerfect 5.1 document format$ AThis section describes the WordPerfect file format for WordPerfect 5.0 (WP5.0 DOS, UNIX, Data General, VAX), WordPerfect 5.1 (WP5.1DOS, inserted UNIX,UNIX, VAX), and WordPerfect 5.1/5.2 for Windows (WPWin5.1/5.2) documents. Note:  WP5.1 (without an extension) refers collectively to WP5.1DOS, WP5.1VAX, inserted WP5.1 UNIX, WP5.1 UNIX, and WPWin5.1/5.2.  A WordPerfect documents are binary files that contain both ASCII characters and special formatting codes. Each document has two major sections: a prefix area and a document area. The prefix area contains:    Information that identifies the file as a WP5.1/5.0 document    Default values for margins, fonts, and other format settings    Information about the selected printer    Graphic images contained in the document The document area contains the actual text and formatting codes that make up the bulk of the file.A  Sizes are referred to as bytes, short (for short integers), or long (for long integers). Depending on the environment and operating system you are working on, these can be translated using the information in the following table. 02CEV쇝Table WPF.1: Size Definitions 쇝Byte character (char) byte 8 bits 쇝Short integer word 16 bits 쇝Long long integer double word 32 bits The original paragraph that was here was deleted and replaced by the following paragraph and 3 block diagrams.All Wordperfect document files follow the Intel "byte reversed" method of storing short and long integer values. In this storage method the high byte of a short integer comes first, and the high short integer comes first in a long integer value. The following two block diagrams represent this storage format.  !#$&')*,-/0235689;<>@ <---------------------- short integer ------------------------> [low byte] [high byte] (high nibble) (low nibble) (high nibble) (low nibble) Bit # 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 !!##%%''))++--//1133557799;;<--------------------------------------- long integer ----------------------------------------> [low short integer] [high short integer] (low byte) (high byte) (low byte) (high byte) 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Decimal numbers larger than 9 are followed, in parentheses "( )", by a number that begins with "0x". This represents the equivalent value in the hexadecimal number system. Singledigit decimal numbers stand alone, because such numbers have the same value in either hexadecimal or decimal. In most cases values are unsigned. An example of how unsigned values are documented is "255 (0xFF)." An example of how signed values are documented is " 1 (0xFF)." Measurements and positions can be stored in one of two units: wpu = WordPerfect units (1 = 1/1200th of an inch, or 0.02117 mm) su = Screen pitch units (1 = 1 screen display column) The file format for the WP4.2 version contains only a document body with function codes. WP4.2 files do not have a prefix header. The WP42FF.TXT file on the Toolkit diskette (PC Developer's Toolkit only) contains the function codes for WP4.2. ˿WordPerfect prefix areaWordPerfect Prefix headerprefix areaPrefix Area  Prefix AreaPrefix HeaderPrefix Area  The prefix area of a WP5.1 document consists of a 16byte file prefix followed by additional prefix information that is specific to the document. This can be any length, depending on the WordPerfect document and file prefix contents. File PrefixPrefix HeaderFile Prefix  All files created by WPCorp products begin with a 16byte file prefix that identifies the file type, product, and version. The file prefix has the following structure:  Field  % -Size 4 EGN 1 W P C Pointer to Document Area Prd File MjV Mnv Encrypt Reserved 65531 (0xFFFB) # Indexes Indx Bk Size Pointer to Next Block Packet Type Length Pointer to Data 1 Packet Type Length Ptr to Data 2 . . . . . . Data 1 Data 1 Data 1 Data 1 Data 1 Data 2 Data 2 Data 2 Data 2 Data 2 . . .   Prefix continued   Document Area  WPCorp File ID  The WPCorp File ID fieldsWPCORP File ID field are the first four bytes of a file and have the same values for all files produced by WPCorp products (excluding WP4.2). It is displayed as " 1WPC" or "FF 57 50 43" in hexadecimal value. If you look at a WPCorp file in any binary program editor or ASCII editor, this ID ought to be there. If you do not see this ID, the file is not a WPCorp 5.x file. Start of Document  The Start of Document field is a long value that begins at offset 4 in the 16byte file prefix heading. This is a pointer to the beginning of the document area. Short integers and long integers are saved in a bytereversed order. Please note that if you place any codes such as margins, tabs, font changes, or a specific page size at the beginning of your document, those codes appear before the actual text begins. Product Type Field  The Product Type field is one byte in length and is the ninth byte from the beginning of the file. It contains a value that identifies the WPCorp software product used to create the file. The field type can have one of the following values: @D   Value %Product  1  WordPerfect 2  Shell 3  Notebook 4  Calculator 5  File Manager 6  Calendar 7  Program Editor/Ed Editor 8  Macro Editor @D @   9  PlanPerfect 10 (0xA)  DataPerfect 11 (0xB)  Mail 12 (0xC)  Printer (PTR.EXE) 13 (0xD)  Scheduler 14 (0xE)  WordPerfect Office 15 (0xF)  DrawPerfect 16 (0x10) LetterPerfect Please remember that other product type values may be added in the future. File Type Field  The File Type field is one byte in length and is the tenth byte from the beginning of the file. The value depends on the Product Type (WPCorp software product) used to create the file. The first ten values (0 9) are reserved for general purpose files that have application across all WPCorp products. The values 10 and above are available for productspecific file types and are listed below in the WordPerfect File Types subsection. General Purpose File Types  These general purpose file types are documented for your information only. These files types are specified for the use of WPCorp software.  Value File  1 Macro file 2 Help file 3 Keyboard definition file 4 VAX keyboard definition file added for WP5.1 (33090) Note:   The Help file does not have a prefix, but the 2 value is still reserved for the help file. Any thirdparty software or application can thus disregard the help file types.  WordPerfect File Types  The file type for WPCorp products is one byte in length and identifies what type of file it is. The values are 16 (0x10) and above, and the file may not specifically be a document file. The following file types are specific to WP5.0 and are also used for WP5.1.  The following file types are specific to WPCorp:  Value % -File  10 (0xA)  WordPerfect document 11 (0xB)  Dictionary file 12 (0xC)  Thesaurus file 13 (0xD)  Block 14 (0xE)  Rectangular block 15 (0xF)  Column block 16 (0x10) Printer resource file (.PRS) 17 (0x11) Setup file (contains the system values for WP{WP}.SET [Setup values, ShiftF1]) 18 (0x12  Reserved 19 (0x13) Printer resource file (.ALL) 20 (0x14) Display resource file (.DRS) 21 (0x15) Overlay file (WP.FIL) 22 (0x16) WP graphic file (.WPG) 23 (0x17) Hyphenation code module 24 (0x18) Hyphenation data module 25 (0x19) Macro resource file (.MRS) 26 (0x1A) WP5.0 Graphics/Text Drivers 27 (0x1B) Hyphenation lex module The following file types were added to the WordPerfect file type for WP5.1:   Value % -File  28 (0x1C)  Printer Q codes (used by VAX/DG) 29 (0x1D)  Spell code module word list 30 (0x1E)  WP.QRS file (WP5.1 equation resource file) 31 (0x1F)  Reserved 32 (0x20)  VAX .SET 33 (0x21)  Spell code module rules 34 (0x22)  Dictionary rules 35 (0x23)  Reserved 36 (0x24)  WP5.1 Graphics/Text Drivers 37 (0x25)  Rhymer word file (WPCorp product, TSR) 38 (0x26)  Rhymer pronunciation file 39 40 (0x27 0x28) "Reserved 41 (0x29)  WP51.INS file (install options file)  Value % -File ˌ 42 (0x2A)  Mouse driver for WP5.1 43 (0x2B)  UNIX Setup file for WP5.0 44 (0x2C)  MAC WP2.0 document 45 (0x2D)  VAX file (WP4.2 document) 46 (0x2E)  External Spell Code Module (WP5.1)    "(This file type is set aside for third parties to create their own speller code modules in WP5.1 DOS) 47 (0x2F)  External Spell Dictionary    "(This file type is set aside for third parties to create their own dictionary ".LEX" files to be read by their speller code.) 48 (0x30)  MAC SOFT graphics file    "(SOFT(Sequential Object FormaT) graphics file for the MAC WP) 49 50 (0x31 0x37) "Reserved 51 (0x38)  WPWin5.1 Application Resource Library added for WPWin5.1 Major and Minor Version Field  The Major and Minor Version fields are each one byte in length. The value in the fields indicates the version number that the file type was created for. The value may or may not correspond to the product's published revision number. The Major version number for WordPerfect 5.x files is 0. Note:   The "Minor Version #" for WP5.0 is 0. The "Minor Version #" was incremented for WordPerfect 5.1 (the value is 1). The "Minor Version #" for WPWin5.1/5.2 is 1, the same number used for WP5.1.  Encryption Key Field  The Encryption Key field is a shortinteger value and occupies the 13th and 14th bytes. It must be a value 0 if the file is not encrypted; otherwise, it must contain a hash value of the password. This hash value is used as a checksum to see if the user typed the correct password. Reserved Field Type  Do not use the Reserved field. It must be zero (0).  ˿Additional Prefix AreaPrefix HeaderAdditional Prefix Area(  The additional prefix area follows the 16byte file prefix. Its structure depends on the product and file type. The additional prefix information for WP5.0 and WP5.1documents is organized into index blocks and data packets. Each index block contains several indexes that point to Prefix Headerdata packetsdata packets. The first index in each block is a special header index that gives the number of indexes in the block. It also gives the pointer to the next block. There can be more than one block (five indexes) in a prefix header, depending on how much information is stored in the prefix. WP5.0 and WP5.1currently store five, and only five, indexes in each index block (the special header index plus four general purpose indexes). Each index block in a WP5.0/5.1 and WPWin5.1/5.2 file consists of a Prefix Headerspecial header index&special header index followed by four indexes that point to data packets. The data packets immediately follow the index block. The prefix area of the file consists of a sequence of index blocks and associated data chained together by the special header index in each index block. Special Header Index  The special header indexPrefix Headerspecial header index& is 10 bytes long. It has the following structure (also illustrated in the shaded area of the diagram):  Offset %Size - 4Usage  0  short " (Packet type for header index 65531 (0xFFFB) 2  short " (# of indexes (including the special header, there are five in WP5.0 and WP5.1 documents.) 4  short " (Size of index block 50 (0x32) (# of indexes * 10) 6  long " (File position of next index block from beginning of file #%,.02468:<>EGN 1 W P C Pointer to Document Area Prd File MjV Mnv Encrypt Reserved 쇝65531 (0xFFFB) # Indexes Indx Bk Size Pointer to Next Block Packet Type Length Pointer to Data 1 Packet Type Length Ptr to Data 2 . . . . . . Data 1 Data 1 Data 1 Data 1 Data 1 Data 2 Data 2 Data 2 Data 2 Data 2 . . .   Prefix continued   Document Area  General Packet Types  The general packet types indexes in the index blockPrefix Headerindex block are also 10 bytes long. They have the following structure and are illustrated in the diagram below:  Offset %Size - 4Usage  0  short " (Packet type 2  long " (Length of data packet 6  long " (File position of data for packet type #%,.02468:<>EGN 1 W P C Pointer to Document Area Prd File MjV Mnv Encrypt Reserved 65531 (0xFFFB) # Indexes Indx Bk Size Pointer to Next Block Packet Type Length Pointer to Data 1 Packet Type Length Ptr to Data 2 . . . . . . Data 1 Data 1 Data 1 Data 1 Data 1 Data 2 Data 2 Data 2 Data 2 Data 2 . . .   Prefix continued   Document Area  Special Data Packet Types  The following special data packet typesPrefix headerdata packet types# are defined for use by all file types:    Value ! & .Packet Type  0   "End of prefix 65531 (0xFFFB) "Header index for index block 65532 (0xFFFC) "Reserved 65533 (0xFFFD) "Reserved 65534 (0xFFFE) "Reserved 65535 (0xFFFF) "Deleted packet (may still exist in file) Notes:   The WP5.1 document prefix has the same structure as it does in WP5.0. However, some data packets have different values in WP5.1 and add new packet types for WP5.1 additional features. Note the following changes listed under packet types. WP5.0 and WP5.1 are forward and reverse compatible. When retrieved into WP5.0, additional features of WP5.1 are recognized as [UNKNOWN] codes. When the document is again retrieved into WP5.1, the [UNKNOWN] codes are recognized as their original features. If Fast Save is not active in WordPerfect 5.1, the file prefix is purged of deleted packets (65535 [0xFFFF]) when the file is saved. If Fast Save is active, deleted packets can still exist in the file prefix after the file is saved.   ˿WordPerfect packet typesWordPerfect Packet Types  The following are data packet types defined for WP5.0/5.1, and WPWin5.1/5.2 documents that are found in the additional prefix area. They are used or referred to in the general packet types structure.   Value ! &Packet Type  1  Document summary packet 2  List of fonts used in document (WP5.0) 3  Document initial codes 4  Reserved 5  Reserved 6  Document specific flags 7  Font name string pool 8  Graphics information 9  Form hash table 10 (0xA)  Reserved 11 (0xB)  Reserved 12 (0xC)  Document printer (.PRS file name, etc.) 13 (0xD)  Reserved 14 (0xE)  Supplemental dictionary compressed words 15 (0xF)  List of fonts used in document (WP5.1) 16 (0x10) DDE link packet added for WPWin5.1 (In UNIX 5.1 only, this packet # indicates the # of pages) 17 (0x11) Macro executable code added for WPWin5.1 18 (0x12) Reserved 19 (0x13) Macro information block added for WPWin5.1 20 (0x14) Reserved 21 (0x15) OLE prefix added for WPWIN 5.2 256 (0x100) First style packet # (use 256 packets for styles) 511 (0x1FF) Last style packet # (use 256 packets for styles) 512 (0x200) PS table packet first packet 767 (0x2FF) PS table packet last packet WP Packet Type Structure for Packets 1 767 (1 0x2FF)  The following are the related structures to the WordPerfect document prefix packet types: Packet Type 1   Document Summary Packet Except for the fields marked and the last 3 fields in the WP5.1 format, all fields are null terminated strings. If a user imports a 5.0 document file into the 11/6/89 release of WP5.1, and the file had a summary packet in it, the following could happen: If the user never edited the summary information, this version of 5.1 would not rewrite the 5.0 summary packet. A document saved out of this version of 5.1, labeled as being a 5.1 document, but has a 5.0 formatted summary packet. Keep this in mind if your program is reading WP5.1 files. A Field   3WP5.1 Max Len FWP5.0 Max Len  ACreation date (string form) % '26 Changed from: 26 25 To: 26 (w/null) 26 (w/null) 68 (no null) 40 68 (no null) 41 (w/null) 21 (w/null)(w/null) 626 (w/null) Descriptive name % '68 (no null) 641 (w/null) Descriptive type % '21 (w/null) 6N/A A   Lengths are padded with spaces to be exact, so that a document management program can change the name or type without completely rewriting the prefix packet.  վASubject  161 '40 Author   '61 640 Typist   '61 640Abstract (comments in WP5.0) '781 6780 End of WP5.0 Document Summary  Account  '161 6N/A Key words  '161 6N/A WP5.1 Format Marker '1 6N/A (always equals 1 [FFh]) Creation date (10byte format) '10 6N/A WP5.1 Format Marker '1 6N/A (always equals 1 [FFh]) Note: "WP5.1 Format Markers" are used by WP to determine whether the summary packet is in the format used by WP5.0 (the markers don't exist) or the expanded format of WP5.1. If the end of the packet data has the value 0FFh (1), then it is a WP5.1 format. If the packet ends with zero, then it is a WP5.0 packet. Packet Type 1 and the 10byte Creation Date format for the Document Summary Packet is as follows:  Offset  4Size HMeaning  0  'short 6Year 2  '1 byte 6Month 3  '1 byte 6Day   4  '1 byte 6Hour 5  '1 byte 6Minute The next four bytes are unused (0) in the Document Summary Packet, but are: 6  '1 byte 6Second 7  '1 byte 6Day_of_week 8  '1 byte 6Time_zone 9  '1 byte 6Unused A Packet Type 2   List of Fonts Used in Document (WP5.0)  This packet is a variablelength list of records. To determine the number of these records, divide the size of the packet by the size of the record structure below. The structure of these records is as follows:  Offset Size 4Usage  0 short 'Font ID (instance pointer) 2 short 'Cache ID of PS table (0xFF [ 1] = no PS table) 4 short 'Top shoulder height (psu) 6 short 'Bottom shoulder height (psu) 8 short 'Printed char width (wpu) 10 short 'Desired space width (wpu) 12 short 'Normal space width (wpu) 14 short 'Horizontal motion units 16 short 'Numerator for fractional units of horizontal motion 18 short 'Pointer into font string pool of font names 20 1 byte 'Flags 21 1 byte 'Available (to ensure short integer alignment) 22 short 'Printer point size in 3600ths (same as offset 26 if not scalable) 24 short 'Hash 26 24 bytes 'Offsets 0 20 of Font Descriptor (See Packet 15 [0xF] for format) 50 16 bytes 'AFC (Automatic Font Changes) list (attribute list) 66 16 bytes 'Character AFC list 82 4 bytes 'Orientation AFC list Packet Type 3   Document Initial Codes  This variablelength packet contains function codes as they appear inside a document. Setup Initial Codes inserts the function codes originally, but you can modify them separately. They keep the system's setup environment and the document together when both are moved to a different environment. Packet Type 4   Reserved (not used)  A Packet Type 5   Reserved (not used)  Packet Type 6   DocumentSpecific Flags and InformationDocument specific flags & information*  This packet contains information about the document itself at the time it was saved. The format of Packet Type 6 is as follows: A  Offset Size 3Usage  0 1 byte 'Flag bits for document   ' bit 0:    ' ,0 = WPWIN Wysiwyg manual display pitch   ' ,1 = WPWIN Wysiwyg auto display pitch   ' bits 1 & 2:    ' , 0 = font change   ' , 1 = red color   ' , 2 = char in left margin   ' , 3 = char in alternating margins   ' bit 3  = 1 if document must be formatted   ' bit 4  = 1 if document must be (re)generated   ' bit 5  = 1 if manual display pitch   ' bit 6  = 1 if links must be updated on retrieval   ' bit 7  = 1 if links codes are not to be displayed 1 1 byte 'Low nibble = print quality   'High nibble = graphics quality   'For each nibble:   ' , 0 = don't print   ' , 1 = draft   ' , 2 = med   ' , 3 = high 2 short 'Redline character 4 short 'Width of screen character 6 short 'Binding width of document 8 1 byte 'Printer select cnt flag for eqn hash 9 1 byte 'Reserved 10 short 'Document display pitch. 0x100 = 100% 12 short 'Screen resolution 14 short 'Reserved A Packet Type 7   Font Name String Pool  This variablelength packet contains the font names in the font list. The font list records each have a field that points to an offset in this packet that indicates its font name. These are nullterminated, font-name strings.  Packet Type 8   Graphics Information  Give special handling to the graphics image dataGraphics image data (Packet Type 8). The index for this data packet must be the last index in the prefix area (except for an End of Prefix index). The value of the long integer length given in the index is 2. The graphic image data has the following structure: @  Offset ,Size >Usage  0 "short 0Count of # of graphic images 2 "long 0Size of first graphic image 6 "long 0Size of second graphic image 10 "long 0Size of third graphic image .. ".. 0.. .. ".. 0.. (# graphics * 4)+2 "variable 0Data for first graphic image (see the DrawPerfect section of this manual for .WPG file formats) + size 1 "variable 0Data for second graphic image + size 2 "variable 0Data for third graphic image .. ".. 0.. .. ".. 0.. .. ".. 0.. Packet Type 9   Forms Hash Table  This variablelength packet is a list of hash values (short integers). The hash values correspond to each form that the user defined. To determine the number of forms hashed, divide the packet size by 2. Packet Type 10 (0xA)   Reserved  Packet Type 11 (0xB)   Reserved  Packet Type 12 (0xC  ) Document Printer (.PRS file, etc.)  This fixedsize packet contains information about the selected printer. The structure is as follows: @@A  Offset Size 5Description  0 37 bytes )Long name of .PRS file 37 13 bytes )Actual .PRS filename 50 24 bytes )Descriptor for initial font 74 short )Minimum top margin 76 short )Minimum bottom margin 78 short )Minimum left margin 80 short )Minimum right margin 82 1 byte )Flags   ) bit 0  = used by printer selection to mark selected printer   ) bit 1  = initialize printer when WP starts   ) bit 3  = right hzone disabled   ) bits 4,5,6,7  = orientations supported 83 short )Date of .PRS file   ) bits 0 4  = day (starting at 1)   ) bits 5 8  = month   ) bits 9 15  = year+80 85 short )Time of .PRS file   ) bits 0 4  = seconds/2 (may not be too accurate)   ) bits 5  10 = minutes   ) bits 11 15  = hour (24 hour starting at 0) 87 short )Point size of current font 89 1 byte )Typeface flags Packet Type 13 (0xD)   Reserved  Packet Type 14 (0xE)   Supplemental Dictionary Compressed Words  Packet Type 15 (0xF)   List of Fonts Used in Document (WP5.1)  Structure of Prefix Font Information  @@@ The following 86byte structure is repeated for each font in a document:   5 fWhere in Offset Size 5Description f.PRS File  0 short )Font ID (instance pointer) OFont def 2 short )Cache ID of PS table ( 1 [0xFF] = no PS table) OFont def 4 short )Top shoulder height (psu) 6 short )Bottom shoulder height (psu) 8 short )Printed char width (wpu) 10 short )Optimal space width (wpu) 12 short )Normal space width (wpu) 14 short )Horizontal motion units 16 short )Numerator for fraction units of horizontal motion OFont def 18 short )Pointer in font string pool of font name OFont def   )(see Packet 7) 20 1 byte )Flags 21 short )Hash of descriptor ("Match font hash value" inFunction209(0xD1) Subfunction 1) 23 27 bytes )Font descriptor (see Font Descriptor below) 50 16 bytes )AFC list (prffont entry #'s, 1 (0xFF) = none) 66 16 bytes )Char afc list 82 4 bytes )Orientation afc list @@  Font Descriptor   Offset Size ,Description ] bWhere in .PRS File  0 short "Cell height (5.0)(3600ths) H LFont def 2 short "Optimal width (wpu) H LFont def 4 short "Cap height (psu) H LTypeface def 6 short "x height (psu) H LTypeface def 8 short "Descender height (psu) H LTypeface def 10 short "Italic adjustment (psu, ) H LTypeface def 12 3 bytes "Typeface descriptor H LTypeface def   " Low short integer:   " ( bit 0  = 1 casual   " ( bit 1  = 1 connected letters   " ( bit 2  = 1 decorative   " ( bit 3  = 1 formal   " ( bit 4  = 1 future   " ( bit 5  = 1 old style   " ( bit 6  = 1 script or calligraphic   " ( bit 7  = 1 cupped   " ( bit 8  = 1 exaggerated   " ( bit 9  = 1 hairline   " ( bit 10  = 1 slab   " ( bit 11  = 1 slanted   " ( bit 12  = 1 transitional   " ( bit 13  = 1 triangular   " ( bit 14  = 1 curved or bowed diagonals   " ( bit 15  = 1 nonconnecting enclosures  Offset Size ,Description ] bWhere in .PRS File    " High byte:   " ( bit 0  = 1 round   " ( bit 1  = 1 square   " ( bit 2  = 1 angular   " ( bit 3  = 1 exaggerated   " ( bit 4  = 1 uniform   " ( bit 5  = 1 ball terminals   " ( bit 6  = 1 tails   " ( bit 7  = 1 reserved; must = 0 15 1 byte "Typeface def flags; same format as offset 26, ex H LTypeface def   "cluding the information added for WP5.1 (for WP5.0) 16 1 byte "Hash of typeface name H LTypeface def 17 1 byte "Quality of the font (only relevant for .DRS fonts) H LFont def 18 short "Hash of font name H LFont def 20 2 short int. "Charset completeness bits H LNonshareable font Def size   "(The completeness bits are read from each of   "the 2 short integers.) A (   Low Short Int. 0High Short Int. ?Meaning    Bit n = 2Bit n =   0 $0 & 0Charset not supported  1 $0 & 0Charset supported 1% 25%  0 $1 & 0Charset supported 26% 59%  1 $1 & 0Charset supported 60% 100% Note:   The "n" in "Bit n =" equals the number of the character set. For example, if you wanted to check the completeness of character set zero (the ASCII character set), you would look at bit zero (0) of the low and high short integers.  @@ 24 short "Point size (5.1) (3600ths) H LFont def 26 1 byte "Typeface def flags H LTypeface def   " (1 ,Small caps font   " (2 ,Shadow font   " (4 ,Outline font   " (8 ,Italic or oblique   " (16 (0x10) H LPS font (font descriptor only)   " ( ,Weight high three bits   " ( , /00000000b extra light   " ( , /00100000b light   " ( , /01000000b normal   " ( , /01100000b demibold   " ( , /10000000b bold   " ( , /10100000b heavy added for WP5.1   " ( , /11000000b black added for WP5.1   " ( , /11100000b ultrablack added for WP5.1 Packet Type 16 (0x10)   DDE Link Packet  added for WPWin5.1 The existence of this packet signifies that the document contains DDE links. The presence of this packet tells the Open and Retrieve functions to scan the document and reestablish the links. Packet Type 16 (0x10)   Total Number of Document Pages  UNIX WP5.1 only  Offset !Size -Description  0 long "# of pages վ Packet Type 17 (0x11)   Macro Executable Code  added for WPWin5.1 This packet is a part of every macro file. Packet Type 18 (0x12)   Reserved  Packet Type 19 (0x13)   Macro Information Block  added for WPWin5.1  Offset !Size -Description  0 10 bytes "Creation date (if this is altered, the macro is recompiled at runtime) Note:  For creation date format, see Document Summary Packet (prefix packet 1) . 10 short "File type 12 short "Major version 14 short "Minor version 16 short "Maintenance version 18 short "Language (for example, US, UK, etc.) 19 short "# of product types in macro The following section is repeated for each product type in offset 19 (above): .. 2 short int. "Product (for example, WPWP) .. short "Product major version .. short "Product minor version .. short "Product maintenance version Packet Type 20 (0x14)   Reserved    Packet Type 21 (0x15)   OLE Prefix  added for WPWin5.2  Offset !Size -Description  0 1 byte "Object Information Structure major version (currently always 1) 1 1 byte "Object Information Structure minor version (currently always 0) 2 short "Size of Object Information Structure (currently always 4) 4 short "# of OLE objects Note:  The following information repeats for each object in the packet. Offset 4 determines how many times the information will be repeated. 6 short "Size of object name (includes the NULL) 8 variable "Object name (nullterminated ANSI string) .. variable "Object information structure (currently contains only an unsigned long integer value. The value is the size of the OLE object) .. variable "OLE object  Packet Type Styles 256511 (0x100 0x1FF)  վ Prefix structure of style packet types. The style library file format is the same as the style prefix information. A style is stored in the prefix in two parts: @ PART_1: Name Type $Description /Unique#@  sizes:   21 1 (55 21 @@ @ PART_2: BegSize BegHash )EndSize 1EndHash :XtrSize ABegText JEndText sizes:  2 #2 ,2 42 =2 E.. M.. Field #Meaning  Name A short name for the style, the actual identifier for the style Type Information about the style  # bit 0  set ,= paired type style  # bit 0  clear ,= global type style  # bit 6,7   # ,0 = Enter = HRt  #  >2  = Enter = Off  #  >3  = Enter = Off/On Description A lengthy description for human use only Unique# A # to identify this style from others BegSize The size of the beginning text BegHash The hash value of the beginning text EndSize The size of the ending text EndHash The hash value of the ending text XtrSize The size of the extra text (auto-added to End_Text) BegText Text and function codes in the Style On code EndText Text and function codes in the Style Off code Xtrtext Codes added to the Style Off code Packet Type 512 767 (0x200 0x2FF)  Structure of Prefix PS prefix informationPS Information  The first three fields uniquely identify a PS table entry: A  Offset Size % 4Meaning  0 1 byte  (PS status flag (0 = bytes, 1 = short int.) 1 1 byte  (Reserved 2 16 short int. (Pointers to the 16character sets ( 1 = pointer is being used) 34 variable (Char widthsA@ .. ..  (._________________. .. char set 1  (| Last char or count 9| Note:  last char + 1 = count .. ..  (| char 0 width 9| .. ..  (| char 1 width 9| .. ..  (| .. 9| .. ..  (| .. 9| .. ..  (| .. 9| .. ..  (._________________. .. char set 2  (| Last char or count 9| .. ..  (| char 0 width 9| .. ..  (| char 1 width 9| .. ..  (| .. 9| .. ..  (| .. 9| Abbreviated PrefixAbbreviated Prefix  One of the following two conditions signals the end of the prefix dataPrefix Headerend of the prefix data(: when an index with a packet type of End of Prefix (0) is encountered, or when the pointer to the next index block in the special header index is equal to 0. To quickly create a simple but valid WordPerfect documentPrefix HeaderWP document prefix, use the following information. This abbreviated prefix enables successful retrieval into WordPerfect. The following sentence was deleted: "This prefix header contains. . . " WordPerfect adds the remaining information when the document is saved after bringing it into WordPerfect (The following values are all in hexadecimal).   FF 57 50 43 4C 00 00 00 01 0A 00 00 00 00 00 00 FB FF 05 00 32 00 00 00 00 00 06 00 08 00 00 00 42 00 00 00 08 00 02 00 00 00 4A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 7C 00 78 00 00 00 00 00  Note: This generic prefix is on disk so you do not have to type it in. It is saved under the filename "PREFIX.QCK." Refer to the "Toolkit Diskette" section to find which disk this file is on.