Record Descriptions




Record Type 1 (0x01)

Start_WPG

Description

Defines the start of WPG data records.

Structure

[horizontal unit of measure (pixels per inch)]

[vertical unit of measure (pixels per inch)]

<position/size data precision>

0 = single (16 bit) precision

1 = double (32 bit) precision

[X coordinate of left edge of viewport]

[Y coordinate of bottom edge of viewport]

[X coordinate of right edge of viewport]

[Y coordinate of top edge of viewport]

[X coordinate of left edge of image extent]

[Y coordinate of bottom edge of image extent]

[X coordinate of right edge of image extent]

[Y coordinate of top edge of image extent]

[next available Object ID]

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

(Form_Settings, Ruler_Settings, Grid_Settings, Font_Settings, Color_Transfer, Brush_Gradient, DP_Brush_Gradient, Brush_Fore_Color, DP_Brush_Fore_Color, Brush_Back_Color, DP_Brush_Back_Color, Brush_Pattern, Color_Palette, DP_Color_Palette)

Notes

The Color_Transfer extension record modifies the page color (even if present after the brush extension records) and must be given Page classification; it does not modify any colors other than the page color.

Brush extension records define the page color and must be given Page classification.

The Horizontal and Vertical Units of Measure fields must not be 0 (zero). These fields describe units of measure for the graphics in the file, but they do not describe the units of measure for text. The Text_Data and Font_Settings records use measurement units of 1200ths or 3600ths of an inch.

The Next Available Object ID field should give the number + 1 of the greatest Object ID used in the file. If there are no Object IDs in the file, this field should be set to 0. This field tells applications where to start generating Object IDs for objects that don't have IDs when the application needs them.


Record Type 2 (0x02)

End_WPG

Description

Defines the end of WPG data records.

Structure

None (zero length data).

Extensions

None.


Record Type 3 (0x03)

Form_Settings

Description

Defines the layout (form size and margins) of the document.

Structure

[form width]

[form length]

[form type]

[left margin]

[right margin]

[top margin]

[bottom margin]

[length of form name]

[form name (WP word string, not null terminated)] x ?

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

None.

Notes

The Form_Settings record must be an extension of the Start_WPG record.

The Length of Form Name field specifies the number of characters in the Form name field, not the number of bytes. (see WordPerfect Word Strings earlier in this section for more information)


Record Type 4 (0x04)

Ruler_Settings

Description

Defines ruler settings used in document preparation.

Structure

[horizontal origin offset]

[horizontal tick interval]

[horizontal hotzone width]

[# of horizontal alignment guides]

[1st horizontal alignment guide position]

[2nd horizontal alignment guide position]

..

..

..

[last horizontal alignment guide position]

[vertical origin offset]

[vertical tick interval]

[vertical hotzone width]

[# of vertical alignment guides]

[1st vertical alignment guide position]

[2nd vertical alignment guide position]

..

..

..

[last vertical alignment guide position]

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

None.

Note

The Ruler_Settings record must be an extension of the Start_WPG record.


Record Type 5 (0x05)

Grid_Settings

Description

Defines grid settings used in document preparation.

Structure

[horizontal grid offset]

[horizontal grid size]

[horizontal grid display interval]

[vertical grid offset]

[vertical grid size]

[vertical grid display interval]

[grid flags]

bit 0: display grid

bit 1: snap to grid

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

None.

Notes

The Grid_Settings record must be an extension of the Start_WPG record.

If present, the Horizontal_Line and/or Vertical_Line records define alignment guides that are in addition to and independent of the grid.


Record Type 6 (0x06)

Layer

Description

Signals the start of a new layer.

Structure

<major layer ID>

<minor layer ID>

[layer flags]

bit 0: active layer

bit 1: layer is invisible

bit 2: editing layer is disabled

[length of layer name]

[layer name (WP word string, not null terminated)] x ?

Extensions

None.

Note

The Length of Layer Name field indicates the number of characters in the Layer Name field, not the number of bytes. See WordPerfect Word Strings earlier in this section for more information.


Record Type 7 (0x07)

Reserved


Record Type 8 (0x08)

Pen_Style_Definition

Description

Defines a pen style that can be used in subsequent Pen_Style records.

Structure

[pen style]

[# of pen definition array element pairs]

[length of first ON segment of pen style]

[length of first OFF segment of pen style]

..

..

..

[length of last ON segment of pen style]

[length of last OFF segment of pen style]

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

None.


Record Type 9 (0x09)

Pattern_Definition

Description

Defines a pattern that can be used in subsequent Pen_Pattern and Brush_Pattern records.

Structure

[pattern index]

[# of resolution thresholds]

[1st resolution threshold]

[2nd resolution threshold]

..

..

..

[nth resolution threshold]

Extensions

Bitmap_Data: One or more.

Notes

Pattern definitions consist of one or more bitmaps that are tailored to specific ranges of device resolutions. Only Bitmap_Data color format 1 (monochrome) is valid. If only one pattern is defined, it is used for all device resolutions. If two patterns are defined, a resolution threshold, R, is also defined so that the first pattern is used when the device resolution is in the range 0 to R and the second pattern is used when the device resolution is in the range R to . The number of resolution thresholds are one less than the number of Bitmap_Data records defining patterns. See Pen/Brush Patterns later in this section for an illustration of the predefined patterns.

The pattern is rendered with the current foreground and background brush colors.


Record Type 10 (0x0A)

Comment

Description

Defines a place holder for embedded non-displayable notation. In order to accommodate product-specific formats, the notation format is not defined by this specification. Applications using this record should tag the data with owner identification "keywords" or "codes" in the Tag Data field.

Structure

{tag length}

<tag data> x ?

Open format data starts here.

Extensions

None.


Record Type 11 (0x0B)

Color_Transfer

Description

Defines one or more color transfer functions that modify RGB intensities of subsequent color specifications.

Structure

[# of transfer functions]

<function1 ID>

<function1 data length>

{function1 data} x ?

<function2 ID>

<function2 data length>

{function2 data} x ?

..

..

..

<functionn ID>

<functionn data length>

{functionn data} x ?

Extensions

None.

Note

The Color_Transfer record defines one or more color transfer functions that combine to define one color transfer array that modifies color intensities specified in subsequent records. Transfer arrays are noncumulative; each array replaces the array in effect prior to the record. The table below gives a complete description of the color transfer functions.



ID # Name Structure Description
1 Contrast {contrast adjustment} Contrast adjustment is a fixed-point value ranging from -1.0 for minimum contrast to +1.0 for maximum contrast.
2 Brightness {brightness adjustment} Brightness adjustment is a fixed-point value ranging from -1.0 for minimum brightness to +1.0 for maximum brightness.
3 Warmth {warmth adjustment} Warmth adjustment is a fixed-point value ranging from -1.0 for coolest colors to +1.0 for warmest colors.







Record Type 12 (0x0C)

Color_Palette

Description

Defines Red-Green-Blue-Transparency color values used within color-indexed bitmaps.

Structure

[starting color index]

[# of entries in color map]

<color1> x 4

<color2> x 4

..

..

..

<colorn> x 4

Extensions

None.

Notes

The Color_Palette record can only be present as an extension of the Start_WPG and the Bitmap records.

The Color_Palette record has two purposes. As an extension of the Bitmap record, it serves its primary purpose of defining the color palette for indexed bitmaps. As an extension of the Start_WPG record, it serves its secondary purpose of defining an initial color palette for editing applications. Applications intended only for rendering graphics can ignore a Color_Palette record saved as an extension of the Start_WPG record.


Record Type 13 (0x0D)

DP_Color_Palette

Description

Defines Red-Green-Blue-Transparency color values used within color-indexed bitmaps.

Structure

[starting color index, i]

[# of entries in color map]

[color1] x 4

[color2] x 4

..

..

..

[colorn] x 4

Extensions

None.

Notes

The DP_Color_Palette record can only be present as an extension of the Start_WPG and the Bitmap records.

This record is identical to the Color_Palette record, except that double-precision color values define the palette.


Record Type 14 (0x0E)

Bitmap_Data

Description

Defines bitmap data.

Structure

[bitmap width (pixels)]

[bitmap height (pixels)]

<color format>

<compression format>

0 = uncompressed data

1 = WP run-length encoding

Bitmap data packed according to the color and encoding formats.

Extensions

None.

Notes

The Bitmap_Data record can only be present as an extension of the Pattern_Definition and Bitmap records.

The color format identifies the method that (decoded) bitmap data uses to describe the colors or gray shades of one or more pixels. See Color Formats under Bitmap Formats later in this section for a detailed list of supported formats. The compression format identifies the method used to convert raw color data to the packed data given in this record. See Data Compression Formats under Bitmap Formats later in this section for a description of the WPC run-length encoding instructions.


Record Type 15 (0x0F)

Text_Data

Description

Defines text data to be contained within either a text line, block, or path.

Structure

[text data (WP word string)] x ?

Extensions

None.

Notes

The Text_Data record can only be present as an extension of the Text_Line and Text_Block records.

See Text Functions later in this section for a list of functions supported within the Text_Line, and Text_Block records. The units of measurement in the Text_Data record are in 1200ths/3600ths of an inch, independent of what is specified in the Start_WPG record.


Record Type 16 (0x10)

Chart_Style

Description

Defines the attributes of all chart elements.

Structure

[characterization flags]

(ROT, TRN, SCL, SKW, TPR)

[Xll coordinate (lower left point)]

[Yll coordinate]

[Xur coordinate (upper right point)]

[Yur coordinate]

<style format ID>

1 = version 1 style format (as used within DrawPerfect 1.1)

2 = version 2 style format (as used within Presentations 2.0)

Chart style records begin here.

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

None.

Notes

The Chart_Style record can only be present as an extension of the Chart record.

The Chart_Style data block is a series of records defining the attributes of various chart elements (for example, frame, legend, labels, series elements, and so forth). See Chart Styles under Chart Styles and Data later in this section for a definition of chart style records as used by version 2. For information on the version 1 chart data records, see the DataPerfect section of the Developer's Toolkit for PC Products.


Record Type 17 (0x11)

Chart_Data

Description

Defines chart data.

Structure

<style data ID>

1 = version 1 style format (as used within DrawPerfect 1.1)

2 = version 2 style format (as used within Presentations 2.0)

Chart data records begin here.

Extensions

None.

Notes

The Chart_Data record can only be an extension of the Chart record.

See the Chart Record Data section under Chart Styles and Datafor a definition of chart data records as used by version 2. For the version 1 chart format, see the DataPerfect section of the Developer's Toolkit for PC Products.


Record Type 18 (0x12)

Object_Image

Description

Describes an object in a single format. This record must follow an Object_Capsule record and normally occurs with other Object_Image records.

Structure

[accessory data length]

<accessory data>

Object data in format defined by the Object_Capsule record.

Extensions

None.

Notes

The Object_Image record can only be present as an extension of the Object_Capsule record.

See Object_Image Formats later in this section for a list of supported formats and a description of supplementary data structures.

Object_Image records of a WPG format are complete WPG files minus the file prefix. They contain Start_WPG and End_WPG records. The precision of WPG2.0 data within an Object_Image record must match the precision of the data in the rest of the file.

An Object_Image record is not required to contain object data if it is used with an Object_Link record to define a class link.

Objects that are WPG2.x format must not begin with a WPCorp Header/Prefix or a Start_WPG record. Any other format (including WPG1.1) requires the entire file.


Record Type 19 (0x13)

Reserved


Record Type 20 (0x14)

Reserved


Record Type 21 (0x15)

Polyline

Description

Defines an area bounded by a series of connected lines through the specified points that are rendered with the current pen, brush, line, and gradient attributes.

Structure

[characterization flags]

(FRM, CLS, FIL, PTH, LCK, OID, ROT, TRN, SCL, SKW, TPR)

[# of vertices]

[X1 coordinate]

[Y1 coordinate]

[X2 coordinate]

[Y2 coordinate]

..

..

..

[Xn coordinate]

[Yn coordinate]

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

None.

Note

If the FIL flag is set but the CLS flag is not set, the polyline should be filled as if it were closed by a straight line segment.


Record Type 22 (0x16)

Polyspline

Description

Defines an area bounded by a B-spline curve that is rendered with the current pen, brush, line, and gradient attributes.

Structure

[characterization flags]

(FRM, CLS, FIL, PTH, LCK, OID, ROT, TRN, SCL, SKW, TPR)

[# of control points]

[X1 coordinate]

[Y1 coordinate]

[X2 coordinate]

[Y2 coordinate]

..

..

..

[Xn coordinate]

[Yn coordinate]

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

None.

Note

If the CLS Characterization flag is set, the B-spline curve should be closed with a final spline section using the final and initial points as spline control points; that is, it should not be closed with a straight line segment. However, if the FIL flag is set but the CLS flag is not set, the polyspline should be filled as if it were closed by a straight line segment.


Record Type 23 (0x17)

Polycurve

Description

Defines an area bounded by a series of connected Bézier curves that are rendered with the current pen, brush, line, and gradient attributes.

Structure

[characterization flags]

(FRM, CLS, FIL, PTH, LCK, OID, ROT, TRN, SCL, SKW, TPR)

[# of nodes (control/anchor/control triplets)]

[X1i coordinate (initial control point)]

[Y1i coordinate]

[X1a coordinate (anchor point)]

[Y1a coordinate]

[X1t coordinate (terminal control point)]

[Y1t coordinate]

..

..

..

[Xni coordinate (initial control point)]

[Yni coordinate]

[Xna coordinate (anchor point)]

[Yna coordinate]

[Xnt coordinate (terminal control point)]

[Ynt coordinate]

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

None.

Note

If the CLS Characterization flag is set, the curve should be closed with a final Bézier curve using the terminal anchor point, the terminal control point, the initial control point, and the initial anchor point; that is, it should not be closed with a straight line segment. However, if the FIL flag is set but the CLS flag is not set, the curve should be filled as if it were closed by a straight line segment.


Record Type 24 (0x18)

Rectangle

Description

Defines a rectangle with rounded corners whose diagonal is defined by the two specified points. The rectangle is to be rendered with the current pen, brush, line, and gradient attributes.

Structure

[characterization flags]

(FRM, FIL, DIR, LCK, OID, ROT, TRN, SCL, SKW,TPR)

[Xll coordinate (lower left point)]

[Yll coordinate]

[Xur coordinate (upper right point)]

[Yur coordinate]

[horizontal radius of corner round]

[vertical radius of corner round]

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

None.

Notes

If either the horizontal radius or the vertical radius is less than or equal to zero, then the corner is assumed to be square rather than rounded.

For the sake of text paths, the path of any rectangle is defined to start and end at the 180 (nine-o'clock) position of the rectangle (before any transformation is applied). The DIR flag specifies whether the path of the rectangle proceeds in a clockwise (DIR flag set) or counterclockwise (DIR flag not set) direction from the rectangle's starting point.


Record Type 25 (0x19)

Arc

Description

Defines an area bounded by an elliptical or circular arc extending between the specified endpoints. The area is to be rendered with the current pen, brush, line, and gradient attributes.

Structure

[characterization flags]

(FRM, CLS, FIL, DIR, LCK, OID, ROT, TRN, SCL, SKW, TPR)

[Xc coordinate (center point)]

[Yc coordinate]

[horizontal radius]

[vertical radius]

[Xi offset (offset of initial endpoint from center point)]

[Yi offset]

[Xt offset (offset of terminal endpoint from center point)]

[Yt offset]

[arc flags]

bit 0: closure style

0 = wedge (ends of arc connected to center point)

1 = chord (ends of arc connected to each other)

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

None.

Notes

The DIR flag does not change the arc itself, only the direction the arc is drawn. The order of the offset points defines whether the arc subtends an angle of or (360-). The arc is defined in a counterclockwise direction as far as the offset points are concerned. The direction of the arc, defined by the DIR flag, is significant not for defining the arc but for defining how text would be rendered along the path of the arc and how the arc would be filled using the winding rule as part of a compound polygon.

The endpoint coordinates, along with the center point, define two line segments. The actual endpoints of the arc are the points of intersection of the arc with these segments. Identical endpoint coordinates define a full ellipse or circle. For the sake of text paths, the path of any full ellipse or circle is defined to start and end at the 180 (nine o'clock) position of the ellipse or circle (before any transformation is applied), regardless of what the two identical endpoint coordinates are.

Closure style flags should be ignored unless the CLS Characterization flag is set. If the FIL flag is set but the CLS flag is not set, the arc should be filled as if it was closed with the chord style, no matter what closure style is set.


Record Type 26 (0x1A)

Compound_Polygon

Description

Defines an area bounded by multiple paths. The area is to be rendered with the current pen, brush, line, and gradient attributes.

Structure

[characterization flags]

(FRM, FIL, PTH, LCK, OID, ROT, TRN, SCL, SKW, TPR)

Extensions

Any combination of Compound_Polygon, Polyline, Polyspline, Polycurve, Rectangle, Arc, Color_Transfer, Pen_Fore_Color, DP_Pen_Fore_Color, Pen_Back_Color, DP_Pen_Back_Color, Pen_Style, Pen_Pattern, Pen_Size, DP_Pen_Size, Line_Join, Line_Cap, Brush_Gradient, DP_Brush_Gradient, Brush_Fore_Color, DP_Brush_Fore_Color, Brush_Back_Color, DP_Brush_Back_Color, Brush_Pattern.

Notes

A Compound_Polygon and a Group differ in two aspects. A Group is a collection of objects, each of which can be rendered with unique attributes. A Compound_Polygon is a single object rendered with a single set of attributes that may contain transparent portions. For example, a compound polygon can be defined with multiple paths using two intersecting circles drawn as a compound polygon. When the circles are filled using the alternating rule, the intersection of the two circles is transparent. The reason for allowing rendition records within the compound polygon is so that if an editing application ungroups the polygons from the compound polygon, they can be restored to their original attributes. However, the rendition records within the compound polygon are ignored for the rendering of the compound polygon.

States of the FRM, FIL, and PTH flags in subsequent extension records are ignored. All paths are rendered according to the flags contained in this record.


Record Type 27 (0x1B)

Bitmap

Description

Defines a rectangular bitmap image.

Structure

[characterization flags]

(LCK, OID, ROT, TRN, SCL, SKW, TPR)

[Xll coordinate (lower left point)]

[Yll coordinate]

[Xur coordinate (upper right point)]

[Yur coordinate]

[source horizontal resolution (pixels per inch)]

[source vertical resolution (pixels per inch)]

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

(Color_Palette/DP_Color_Palette) Bitmap_Data

Notes

A value of 0 in the source resolution parameters indicates that the source resolutions are unknown.

If a Color_Palette/DP_Color_Palette record is included, it must be the first extension record (before the Bitmap_Data record).


Record Type 28 (0x1C)

Text_Line

Description

Defines a string of text characters whose baseline is specified by the given directional vector.

Structure

[characterization flags]

(LCK, OID, ROT, TRN, SCL, SKW, TPR)

[text flags]

bit 14: mirror text along baseline (around center-point of text)

bit 15: mirror text over baseline

[Xref coordinate (reference point)]

[Yref coordinate (reference point)]

<horizontal alignment>

0 = left

1 = center

2 = right

<vertical alignment>

0 = top

1 = cap

2 = x-line

3 = baseline

4 = bottom

{baseline angle}

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

Text_Data

Note

The horizontal and vertical alignment parameters define the position of the reference point relative to the text. Values of 0 and 3 respectively indicate that the reference point given is the left end of the baseline. Values of 1 and 2 indicate that the reference point is the right end of the line at the top of lowercase letters. Alignment should take place before any mirroring.

The units of measurement of the reference point coordinates are those defined in the Start_WPG record, whereas the units of measurement in the Text_Data record are always in 1200ths/3600ths of an inch.

If there is a transformation, the transformation applies to the text.


Record Type 29 (0x1D)

Text_Block

Description

Defines a rectangular region through which a single string of text flows.

Structure

[characterization flags]

(LCK, OID, ROT, TRN, SCL, SKW, TPR)

[Xll coordinate (lower left point)]

[Yll coordinate]

[Xur coordinate (upper right point)]

[Yur coordinate]

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

Text_Data

Notes

The units of measurement of the lower left and upper right point coordinates are those defined in the Start_WPG record, whereas the units of measurement in the Text_Data record are always in 1200ths/3600ths of an inch.

If there is a transformation, the transformation applies to the text.

Between lines in a text block, there is assumed to be a leading of 1/16th of the previous line's maximum point size. There is no leading or shoulder height assumed on any side of the bounding rectangle.


Record Type 30 (0x1E)

Text_Path

Description

Defines a curved path that the specified text string uses for a contoured baseline.

Structure

[characterization flags]

(LCK, OID, ROT, TRN, SCL, SKW, TPR)

[text flags]

bits 0-2: vertical alignment

0 = top

1 = cap

2 = x-line

3 = baseline

4 = bottom

bits 03-04: horizontal justification

0 = left

1 = center

2 = right

3 = full

bit 08: mirror text along path (around center point of text)

bit 09: mirror text over path (not inside text cell)

bit 14: wrap text around path (past start/end of path)

bit 15: display path

[path justification percentage]

Extensions

Any (or none) of Pen_Fore_Color, DP_Pen_Fore_Color, Pen_Back_Color, DP_Pen_Back_Color, Pen_Style, Pen_Pattern, Pen_Size, DP_Pen_Size, Line_Join, Line_Cap interspersed with at least one of Polyline, Polyspline, Polycurve, Rectangle, or Arc; Text_Line or Text_Block

Notes

Horizonal justification and vertical alignment should be done before any mirroring.

The vertical alignment field of the Text Flags parameter indicates which position within the cell height to align to the path.

The first set of extension records gives the description of the text path, including attributes of the path in the event that it is to be rendered. Valid path description records are any combination of Polyline, Polyspline, Polycurve, Rectangle, and Arc. Immediately following the path description record is either a Text_Line or Text_Block record defining an alternate text container in the event the text is to be separated from the path. Although Text_Data is not a valid Text_Path extension record, it follows as an extension of the alternate container record.

The attribute records and path description extension record use the units of measurement given in the Start_WPG record. However, the text data uses 1200ths/3600ths of an inch.

The DIR characterization flag is not valid for the Text_Path record itself, but it may be set on Arc and Rectangle records that define the path to indicate that the text should be rendered in a clockwise direction.

There are times when the text data is longer than the path on either the starting end of the path or the last end of the path or both. When that happens, there are two options. If the wrap flag is set, then the text should continue around the path. If the wrap flag is not set, then the text should continue in the direction it was last going at the endpoint of the path.

The Path Justification Percentage field specifies the point along the path (as a percentage of the length of the path) about which the horizontal justification is performed. The percentage is given in the range 0 to 65535 (e.g. 32768 is equivalent to 50%). If full horizontal justification is set, then the percentage is meaningless except for closed paths where the percentage means where to start the text on the path.

If there are any transformations on a text container record (Text_Line or Text_Block) within the Text_Path definition, the transformations should be applied to the text but not to the path.

The figure below shows some common text path options and how the Text Flags and Percentage fields would be set on the text path and how the DIR flag would be set on the objects to obtain the desired result.




Record Type 31 (0x1F)

Chart

Description

Defines a chart with textual, numeric, and graphic data.

Structure

[characterization flags]

(LOC, LCK, OID, ROT, TRN, SCL, SKW, TPR)

[Xll coordinate (lower left point)]

[Yll coordinate]

[Xur coordinate (upper right point)]

[Yur coordinate]

<chart type>

0 = data chart

1 = text chart

2 = organizational chart

3 = Draw Perfect 1.x chart

<chart sub-type>

0 = bar

1 = line

2 = area

3 = scatter

4 = hi-lo

5 = custom Mixed

6 = surface

7 = table

8 = pie

<chart flags>

bit 0: user data flag

bit 1: user style flag

bit 2: static flag

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

Chart_Style, Chart_Data, Group

Note

The purpose of the group extension of the Chart record is to provide rendering information for the chart for those applications that do not understand the Chart_Style and Chart_Data records. All three extension records are mandatory.


Record Type 32 (0x20)

Group

Description

Defines an object that is a group of WPG records.

Structure

[characterization flags]

(LOC, GRP, LCK, OID, ROT, TRN, SCL, SKW, TPR)

[Xll coordinate (lower left point)]

[Yll coordinate]

[Xur coordinate (upper right point)]

[Yur coordinate]

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

Any WPG image record except Layer.

Note

A Group and a Compound_Polygon differ in two aspects. A Group is a collection of objects, each of which can be rendered with unique attributes. A Compound_Polygon is a single object rendered with a single set of attributes that may (because it can be defined with multiple paths) contain transparent portions.


Record Type 33 (0x21)

Object_Capsule

Description

Defines a collection of one or more descriptions of an object. Object descriptions are contained in subsequent extension (Object_Link or Object_Image) records.

Structure

[characterization flags]

(LOC, LCK, OID, ROT, TRN, SCL, SKW, TPR)

[Xll coordinate (lower left point)]

[Yll coordinate]

[Xur coordinate (upper right point)]

[Yur coordinate]

[# of object descriptions]

<1st object description format>

<1st object description minor-revision #>

<1st object description flags>

bit 2: external data flag

bit 3: print-only flag

bit 4: render-only flag

bit 5: edit-only flag

bit 6: gray-scale flag

bit 7: vector flag

<1st object description depth (bits per pixel)>

[1st object description horizontal resolution (pixels per inch)]

[1st object description vertical resolution (pixels per inch)]

..

..

..

<nth object description format>

<nth object description minor-revision #>

<nth object description flags>

(see 1st object description flags above)

<nth object description depth (bits per pixel)>

[nth object description horizontal resolution (pixels per inch)]

[nth object description vertical resolution (pixels per inch)]

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

Object_Image or Object_Link: One or more.

Notes

See Object_Image Formats later in this section for a list of supported formats. A format is characterized as either bitmap or vector by the most significant bit (bit 7) of the description flags parameter (0 = bitmap, 1 = vector). If bit 6 is set, the colors of the object are gray scale values; otherwise, they are RGB values. If bit 5 is set, the object is used only for graphics editing applications. If bit 4 is set, the object is used only for graphics rendering (not editing) applications. If bit 3 is set, the object is used only for printing. If bit 4 or 5 is set, other bit should be 0; that is, these two flags are mutually exclusive. If neither of these two bits are set, the object is used for all types of applications.

Objects that are WPG2.x format must not begin with a WPCorp Header/Prefix or a Start_WPG record. Any other format (including WPG1.1) requires the entire file.

Future applications can use this record to save multiple minor revisions of the WPG 2 format for objects so that current applications can still render data from new features. The minor-revision number, together with the description flags, can be used to determine the WPG objects that the application renders.


Record Type 34 (0x22)

Font_Settings

Description

Defines the default font size and face for all Text_Data records.

Structure

[desired horizontal point size (3600ths)]

[desired vertical point size (3600ths)]

<fixed-length part of 6.0 typeface descriptor (for best-fit matching)> x 22

[total string length of four font name strings, in bytes (including all nulls)]

[typeface name and pitch/point size (null-terminated word string)] x ?

[attribute description (null-terminated word string)] x ?

[extension (null-terminated word string)] x ?

[group (null-terminated word string)] x ?

Extensions

None.

Notes

The Font_Settings record can only be present as an extension of the Start_WPG record. If this record is not present, there is no default for font size and face.

If the Total String Length is zero, Typeface Name and Pitch/Point Size, Attribute Description, Extension, and Group do not exist. In this case the font is best-fit matched according to the values in the fixed-length part of the typeface descriptor. See the Document File Format section for a detailed description of the font descriptor fields.

When the value in Total String Length is nonzero, all of the last four fields exist even if only one of them is in use. For example, if the attribute description contained 4 short integer characters (including a null on the end), the Total String Length is 14 (0xE). This is because the Typeface Name, Extension, and Group fields would each contain a short integer NULL. If the Typeface Name field had 6 short integer characters and no other field was used, the total length would be 18. Attribute, Extension, and Group fields would each have a short integer NULL.


Record Type 35 (0x23)

Reserved for Line_Cap_Definition


Record Type 36 (0x24)

Reserved for Line_Join_Definition


Record Type 37 (0x25)

Pen_Fore_Color

Description

Defines the pen foreground color attribute used to render subsequent objects and paths.

Structure

<pen foreground color value> x 4

Extensions

None.

Note

The pen foreground color is used to draw the foreground color of the pen pattern. If no pen pattern is specified, the pen pattern is solid and drawn exclusively with the pen foreground color.


Record Type 38 (0x26)

DP_Pen_Fore_Color

Description

Uses double-precision color to define the pen foreground color attribute used to render subsequent objects and paths.

Structure

[double-precision pen foreground color value] x 4

Extensions

None.

Note

This record is equivalent to the Pen_Fore_Color record, except that it uses a double-precision color value.


Record Type 39 (0x27)

Pen_Back_Color

Description

Defines the pen background color attribute used to render subsequent objects and paths.

Structure

<pen background color value> x 4

Extensions

None.

Note

The pen background color is used to draw the background color of the pen pattern. If no pen pattern is specified, the pen pattern is solid, and the background color is not used for drawing lines.


Record Type 40 (0x28)

DP_Pen_Back_Color

Description

Uses double-precision color to define the pen background color attribute used to render subsequent objects and paths.

Structure

[double-precision pen background color value] x 4

Extensions

None.

Note

This record is equivalent to the Pen_Back_Color record, except that it uses a double-precision color value.


Record Type 41 (0x29)

Pen_Style

Description

Defines the pen style attribute used to render subsequent objects and paths.

Structure

[pen style]

Extensions

None.

Note

Sets the current pen style to a predefined pen style (see Pen Styles later in this section) or to a custom pen style that was defined using the Pen_Style_Definition record. Setting the pen style to 0 restores it to a solid line.


Record Type 42 (0x2A)

Pen_Pattern

Description

Defines the pen pattern attribute used to render subsequent objects and paths.

Structure

[pen pattern]

Extensions

None.

Note

Sets the current pen pattern to a predefined pattern (see Pen/Brush Patterns later in this section) or to a custom pattern that was defined using the Pattern_Definition record. Setting the pen pattern to 0 restores it to a solid pattern.


Record Type 43 (0x2B)

Pen_Size

Description

Defines the pen size attributes used to render subsequent objects and paths.

Structure

[pen width (0 = hairline)]

[pen height (0 = hairline)]

Extensions

None.

Note

A value of 0 in the pen width or pen height parameters signifies the thinnest pen width or height that can be rendered at the output device resolution (one pixel).


Record Type 44 (0x2C)

DP_Pen_Size

Description

Defines the pen size attributes (using double-precision sizes) used to render subsequent objects and paths.

Structure

{pen width (0 = hairline)}

{pen height (0 = hairline)}

Extensions

None.

Note

This record is equivalent to the Pen_Size record, except that it uses double-precision size values.


Record Type 45 (0x2D)

Line_Cap

Description

Defines the line cap attributes used to render subsequent objects and paths.

Structure

<initial line cap style>

<terminal line cap style>

Extensions

None.

Notes

Sets the line cap type to one of the predefined caps listed in the table below (range 0-9) or to a user-defined cap defined by a Line_Cap_Definition record (not yet available) (range 10-255). Rendering applications (not editing applications) should set the line cap type to None (flat) whenever they encounter a user-defined line cap type.



Type # Name
0 (0x0) None (Flat)
1 (0x1) Round
2 (0x2) Square
10 (0xA) Arrow (This type is predefined as an arrow, but can be redefined by the user.)






Predefined line caps apply only to wide lines; that is, to lines rendered with a pen width and height greater than zero (see Line Cap under Class earlier in this section).


Record Type 46 (0x2E)

Line_Join

Description

Defines the line join attribute used to render subsequent objects and paths.

Structure

<line join style>

Extensions

None.

Notes

Sets the line join type to one of the predefined joins listed in the table below (range 0-9) or to a user-defined join defined by a Line_Join_Definition record (not yet available) (range 10-255). Rendering applications (not editing applications) should set the line join type to None whenever they encounter a user-defined line join type.



Type # Name
0 (0x0) None
1 (0x1) Bevel
2 (0x2) Miter
3 (0x3) Round






Predefined line joins only apply to wide lines; that is, to lines rendered with a pen width and height greater than zero (see Line Join under Class earlier in this section).


Record Type 47 (0x2F)

Brush_Gradient

Description

Defines the brush gradient attributes used to render subsequent objects and paths.

Structure

{brush gradient angle}

[horizontal gradient reference (Xref)]

[vertical gradient reference (Yref)]

<brush gradient flag>

bit 6: granularity flag

bit 7: anchor flag

[horizontal gradient extent minimum (Xmin)]

[vertical gradient extent minimum (Ymin)]

[horizontal gradient extent maximum (Xmax)]

[vertical gradient extent maximum (Ymax)]

Extensions

None.

Notes

The gradient angle (a fixed-point number) specifies the angle of rotation of the gradient from a default orientation. The default linear orientation is a top-to-bottom shading (horizontal gradient bands).

The gradient reference (Xref,Yref) specifies the offset of the gradient center point from the lower left corner of either the page or an object's extent rectangle. The offset is expressed as a fraction in units of 1/65535 of the extent. For example, the reference value of a gradient centered in an object is 32767,32767 (0x7FFF,0x7FFF).

The anchor flag defines whether the gradient is rendered relative to the extent of each object or to a supplied extent. An anchor style value of 0 defines an object-relative gradient that extends to the edges of filled objects. An anchor style value of 1 defines a gradient relative to the supplied extent. The gradient extent data is provided only if the anchor style is set. The gradient extent (if provided) must be at least large enough to encompass the objects being filled.


Record Type 48 (0x30)

DP_Brush_Gradient

Description

Defines the brush gradient attributes (using double-precision values) used to render subsequent objects and paths.

Structure

{brush gradient angle}

[horizontal gradient reference (Xref)]

[vertical gradient reference (Yref)]

<brush gradient flag>

bit 6: granularity flag

bit 7: anchor flag

{horizontal gradient extent minimum (Xmin)}

{vertical gradient extent minimum (Ymin)}

{horizontal gradient extent maximum (Xmax)}

{vertical gradient extent maximum (Ymax)}

Extensions

None.

Note

This record is equivalent to the Brush_Gradient record, except that the extent (if provided) is given with double-precision point values. As with the Brush_Gradient record, extent fields only appear in the record if the anchor flag bit (bit 7 of the brush gradient flag field) is set to 1.


Record Type 49 (0x31)

Brush_Fore_Color

Description

Defines the brush foreground color attributes used to render subsequent objects and paths.

Structure

<brush gradient type>

brush gradient type = 0:

<brush foreground color value> x 4

brush gradient type <> 0:

[# of brush foreground colors]

<brush foreground color 1 (red)>

<brush foreground color 1 (green)>

<brush foreground color 1 (blue)>

<brush foreground color 1 (transparent)>

<brush foreground color 2 (red)>

<brush foreground color 2 (green)>

<brush foreground color 2 (blue)>

<brush foreground color 2 (transparent)>

..

..

..

[brush color position array] x ?

Extensions

None.

Notes

The brush foreground color is used to draw the foreground color of the brush fill pattern. If no brush pattern is specified, the pattern is solid, and the foreground color is the only color used for rendering fills. Closed objects can be filled with a pattern and a gradient. Although this file format allows for closed objects to be filled with both a pattern and a gradient, some platforms may not support gradient colors across a pattern.

If the brush gradient type is None (0), only a single color value is present. Otherwise, the gradient data is provided. The table below lists the Brush Gradient Types.



Type # Brush Gradient Type
0 (0x00) None
1 (0x01) Linear
2 (0x02) Polygonal
3 (0x03) Concentric Circles
4 (0x04) Convergent Circles
5 (0x05) Concentric Ellipses
6 (0x06) Convergent Ellipses
7 (0x07) Concentric Squares
8 (0x08) Convergent Squares
9 (0x09) Concentric Rectangles
10 (0x0A) Convergent Rectangles






Any number of colors, as defined by the brush foreground color array, can be distributed across the range of the gradient. The first color in the array is the inner color (the color overlaying the reference point). The last color in the array is the outer color (the color farthest from the reference point).

The brush color position array controls the positioning of colors given in the foreground color array in a way that is dependent on the state of the gradient granularity flag (see Brush_Gradient earlier in this section). It has one less element than the color array because "n" colors divide an area into "n-1" regions. When the gradient granularity flag is 0, the position array specifies the number of steps from color Cito color Ci+1. The total number of gradient bands is one greater than the sum of the values in the position array. When the granularity flag is set to 1, the gradient granularity is minimized (number of gradient bands is maximized) - limited only by the resolution of the output device and the difference in the gradient colors. The distance, Di, between two adjacent gradient colors, Ci and Ci+1, is



where E is the extent of the gradient, n is the number of gradient colors, and Pi is an element of the position array. Position array elements must have nonzero values.


Record Type 50 (0x32)

DP_Brush_Fore_Color

Description

Defines the double-precision brush foreground color attributes used to render subsequent objects and paths.

Structure

<brush gradient type>

brush gradient type = 0:

[brush foreground color value] x 4

brush gradient type <> 0:

[# of brush foreground colors]

[brush foreground color 1 (red)]

[brush foreground color 1 (green)]

[brush foreground color 1 (blue)]

[brush foreground color 1 (transparent)]

[brush foreground color 2 (red)]

[brush foreground color 2 (green)]

[brush foreground color 2 (blue)]

[brush foreground color 2 (transparent)]

..

..

..

[brush color position array] x ?

Extensions

None.

Note

This record is equivalent to the Brush_Fore_Color record, except that it uses double-precision color values.


Record Type 51 (0x33)

Brush_Back_Color

Description

Defines the brush background color attribute used to render subsequent objects and paths.

Structure

<brush background color value> x 4

Extensions

None.

Note

The brush background color is used to draw the background color of the brush fill pattern. If no brush pattern is specified, the pattern is solid, and the background color is not used for rendering fills.


Record Type 52 (0x34)

DP_Brush_Back_Color

Description

Defines the double-precision brush background color attribute used to render subsequent objects and paths.

Structure

[brush background color value] x 4

Extensions

None.

Note

This record is equivalent to the Brush_Back_Color record, except that it uses double-precision color values.


Record Type 53 (0x35)

Brush_Pattern

Description

Defines the brush pattern attribute used to render subsequent objects and paths.

Structure

[brush pattern]

Extensions

None.

Note

Sets the current brush pattern to a predefined pattern (see Pen/Brush Patterns later in this section) or to a custom pattern that was defined using the Pattern_Definition record. Setting the pen pattern to 0 restores it to a solid pattern.


Record Type 54 (0x36)

Horizontal_Line

Description

Defines a horizontal line to be used as an alignment guide.

Structure

[Y coordinate]

[X1 coordinate]

[X2 coordinate]

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

None.

Note

This record can only be present as an extension to the Grid_Settings record.


Record Type 55 (0x37)

Vertical_Line

Description

Defines a vertical line to be used as an alignment guide.

Structure

[X coordinate]

[Y1 coordinate]

[Y2 coordinate]

The field length may be double, based on data precision or Object ID. See Field Precision under Record Structureearlier in this section for more detailed information.

Extensions

None.

Note

This record can only be present as an extension to the Grid_Settings record.