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. |
Pattern, bitmap and texture fills give a pattern or bitmap id, a tile size and offsets, with layouts that differ from version to version; they are not described here.
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 a header of its own with the colour model, width, height, bits per
pixel, palette and pixels; a second image, a mask, can follow. That header is not
described here.