From CorelDRAW 4 on, fills, outlines, fonts and bitmaps are kept in tables in the LIST doc, and each object names the ones it uses by id. These are the layouts libcdr reads; bytes it steps over are marked unknown. “Coordinate”, “angle” and “unsigned” change size with the version, as on the objects page.
Colours
A colour is a colour model and a 32-bit value whose four bytes are the components, lowest byte first.
| Version | Layout | Size |
|---|---|---|
| 3 | Model (1 byte), value (4 bytes). | 5 |
| 4 | Model (2), four 16-bit components, 2 unknown. The value is made of the low byte of each component. | 12 |
| 5 and later | Model (2), palette (2), 4 unknown, value (4). Model 0x1E has no palette or unknown bytes: model, then value. | 12, or 6 |
| Model | Meaning | Value bytes, lowest first |
|---|---|---|
| 1, 2, 21 | CMYK, 0 to 100 | C, M, Y, K. From X3, libcdr reads model 1 as a palette colour. |
| 3, 17 | CMYK, 0 to 255 | C, M, Y, K. |
| 4 | CMY | C, M, Y, unused. |
| 5 | RGB | Blue, green, red, unused. |
| 6 | HSB | Hue (16 bits, degrees), saturation, brightness (0 to 255). |
| 7 | HLS | Hue (16 bits), lightness, saturation. |
| 8 | Black and white | Not zero for black. |
| 9 | Greyscale | Grey level, 0 to 255. |
| 11 | YIQ | Y, I, Q. |
| 12, 18 | Lab | L, a, b (18 stores a and b offset by 128). |
| 20 | Registration colour | Tint, 0 to 100. |
| 25, 30 | Spot colour from a palette | The low 16 bits are the palette entry. |
fill and fild: fills
| Field | Size | Description |
|---|---|---|
| Fill id | 4 | The id objects use. |
| Unknown | 8 | X3 and later. |
| Fill type | 2 | 0 none, 1 solid, 2 gradient, 7 two-colour pattern, 9 bitmap, 10 full-colour pattern, 11 texture. |
| Rest | varies | Depends on the type, as below. |
Solid
2 unknown bytes (13 from X3), then one colour.
Gradient
| Field | Size | Description |
|---|---|---|
| Unknown | 2 (8 from X3) | |
| Gradient type | 1 | 1 linear, 2 radial, 3 conical, 4 square. |
| Unknown | 11 (19 from version 6, 17 from X3) | |
| Edge pad | 2 (4 from version 6, 2 from X3) | Signed. |
| Angle | angle | The direction of the gradient. |
| Centre x and y offsets | 2 × signed | For radial, conical and square gradients, in percent. |
| Unknown | 2 | Version 6 and later. |
| Mode | unsigned | How the colours blend; libcdr keeps the low byte. |
| Midpoint | 1 | In percent. |
| Unknown | 1 | |
| Number of colours | unsigned | libcdr keeps the low 16 bits. 3 unknown bytes follow from X3. |
| Stops | varies | For each: a colour; 5 unknown bytes from X3 (26 from X5); the position in percent as an unsigned; 3 unknown bytes from X3. |
Types 8 and 12 (a PostScript fill, and one libcdr does not read) have no layout in libcdr: its reader leaves them as a type and nothing else.
Two-colour pattern (type 7)
| Field | Size | Description |
|---|---|---|
| Unknown | 2 (8 from X3) | |
| Pattern id | 4 | A pattern of the bitmap pattern list (bmpf). |
| Tile width, height | 2 × integer | Thousandths of an inch before version 6, 1/254,000 inch later. |
| Tile offsets | 2 × 2, or 4 unknown | Before version 9: x and y offsets in percent (the value ÷ 100). From 9: 4 unknown bytes. |
| Row or column offset | 2 | Percent. |
| Flags | 1 | Bit 0x04 before version 9: the tile size is a percent of the object. |
| Unknown | 1 (6 from X3) | |
| Foreground colour | colour | |
| Unknown | 0 (10 from X3, 31 from X6) | |
| Background colour | colour |
Bitmap, full-colour and texture fills (types 9, 10, 11)
Type 9 is a bitmap fill, 10 a full-colour (vector) pattern, 11 a texture; before version 6 libcdr reads types 9 and 11 as type 10.
| Field | Size | Description |
|---|---|---|
| Unknown | 2 | Before X3. |
| Pattern id | unsigned (4 for a texture) | The bitmap or pattern. |
| Tile width, height | 2 × unsigned | A texture has them from version 6 only. |
| Tile offsets, row offset, flags | as for a two-colour pattern | |
| Tile (type 10, versions 6 to 12) | 1 + 4 coordinates + 4 | The rectangle of the pattern’s own drawing that is the tile: x0, y0, x1, y1. |
| Unknown | 21 (17 from X3) | Types 9 and 11, and type 10 before version 6; type 10 from 6 to 12 has the tile instead. |
| Pattern id | unsigned | Version 6 and later: read again; libcdr uses this one. |
From X3 the fields start after a run of optional records: a 32-bit tag
0x640 is followed by a length and that many bytes, 0x514 by
4 bytes. libcdr steps over them and then back four bytes before reading the fields,
so they overlap the bytes before the first field. The explorer shows these fills
whole as one block of bytes for that reason.
outl: outlines
| Field | Size | Description |
|---|---|---|
| Outline id | 4 | The id objects use. |
| Records | varies | X3 and later: records of a 4-byte id and a 4-byte length, up to the one with id 1. The fields below follow its header. |
| Line type | 2 | Bit 0x01: no outline. Bit 0x04: dashed. Bit 0x20: the width scales with the object. |
| Caps | 2 | 0 butt, 1 round, 2 square. |
| Joins | 2 | 0 mitre, 1 round, 2 bevel. |
| Unknown | 2 | Versions 6 to 12 only. |
| Width | coordinate | The line width. |
| Stretch | 2 | The nib’s stretch, in percent. |
| Unknown | 2 | Version 6 and later. |
| Nib angle | angle | |
| Unknown | 0, 52 or 46 | None up to version 5, 52 for 6 to 12, 46 from X3. |
| Colour | colour | The line colour. |
| Unknown | 10 or 16 | 10 up to version 5, 16 later. |
| Number of dashes | 2 | n. |
| Dashes | n × 2 | Dash and gap lengths, in line widths. |
| Arrowheads | 2 × 4 | Start and end arrowhead ids, 20 bytes (22 from version 6) after the number of dashes. |
font: fonts
| Field | Size | Description |
|---|---|---|
| Font id | 2 | The id text uses. |
| Character set | 2 | Version 5 and later: the Windows character set. |
| Unknown | 14 | Version 5 and later. |
| Name | varies | Ending in a zero: 8-bit characters up to version 11, UTF-16 from version 12. |
bmp: bitmaps
Each bmp chunk starts with an unsigned bitmap id. Up to version 4 a
complete Windows bitmap file follows, starting BM, with its size at bytes
2 to 5. From version 5 libcdr steps over 14 bytes (46 in version 6, 50 from version 7)
and then reads the image header below; a second image, a mask, can follow. The next
page of this section, Text and styles, covers
the records that use fonts and fills.
| Field | Size | Description |
|---|---|---|
| Colour model | 4 | 0 Pantone, 1 RGB, 2 CMY, 3 CMYK, 4 HSB, 5 greyscale, 6 black and white, 7 HLS, 10 RGB, 11 Lab; 8 and 9 hold colours as the drawing’s models do. |
| Unknown | 4 | |
| Width | 4 | Pixels. |
| Height | 4 | Pixels. |
| Unknown | 4 | |
| Bits per pixel | 4 | 1, 8, 24 or 32. |
| Unknown | 4 | |
| Pixel data size | 4 | Bytes, rows padded; libcdr takes the row length as this divided by the height. |
| Unknown | 32 | |
| Palette | 2 unknown, a 2-byte count, then 3 bytes an entry | Only when the bits per pixel are under 24 and the model is not 5 or 6. Entries are blue, green, red, in the bitmap’s colour model. |
| Pixels | the size above | The bottom row first. Model 6: one bit a pixel, a set bit white. Model 5: a grey level a byte. With a palette: an index a byte. 24 bits: blue, green, red. 32 bits: four component bytes of the model. |
A mask follows when more than 78 bytes are left after the pixels and they start
RI: 2 + 20 unknown bytes, the mask’s width, height, 4 unknown bytes, bits
per pixel (it must be 8), 4 unknown, its data size, 32 unknown bytes and the data, a
byte a pixel. When the size matches the image, the bytes are the pixels’ opacity.
arrw: arrowheads
Version 5 and later; an outline’s start and end arrowhead fields name them.
| Field | Size | Description |
|---|---|---|
| Arrowhead id | 4 | |
| Unknown | 2 (4 from version 6) | |
| Number of points | 2 | n. |
| Unknown | 4 | |
| Point types | n | As for a curve: 0x00 start, 0x40 line, 0xC0 control point, 0x80 curve end, bit 0x08 closes. |
| Unknown | 1 | |
| Points | n × 2 coordinates | Along the line, then across it. The tip is at 0, 0 and the body at negative “along” values. |
Size, from measurements of PDF exports made for libcdr’s notes: one unit is twice the line’s width, but not less than 0.028 inch. Closed parts of the arrowhead are filled with the line colour; open parts are stroked with the line’s width.
Other small records
| Chunk | Holds |
|---|---|
ftil | A fill’s tile transformation: six doubles a, b, c, d, e, f; c and f in 1/254,000 inch. |
bmpf | A pattern bitmap: a 32-bit id, then a 1-bit bitmap with a 40-byte header (width, height, 1 bit, size); the pixels are the last bytes of the record. |
vpat | A full-colour pattern: the fill id, then a CMX file of its objects. |
ppdt | Points of an effect: a 16-bit count, 4 unknown bytes, the points (two coordinates each), then a 32-bit knot number for each. |
uidr | A document palette entry: colour id, user id, 36 unknown bytes and a colour. |
spnd | Which text an object shows: an unsigned number, the frame id of a txsm record. |
olel | An embedded object’s link: 4 unknown bytes, then the number of its Embedding n storage in the ole2 record, which is an OLE compound file. |
iccd | An ICC colour profile, the whole record. |
udta | User data: in versions 13 to 15, 6 unknown bytes and a UTF-16 field name. |