The structures used inside records, and the named values their fields can hold. Numbers are little-endian.
Pen object
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | PenStyle | Style flags, see below. |
| 2 | 4 | PointS | Width | X is the pen width in logical units. Y is not used. |
| 6 | 4 | ColorRef | ColorRef | Pen colour. |
LogBrush object
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | BrushStyle | Brush style, see below. |
| 2 | 4 | ColorRef | ColorRef | Colour of the brush. |
| 6 | 2 | u16 | BrushHatch | Hatch style when BS_HATCHED. |
Font object
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | s16 | Height | Character height in logical units. |
| 2 | 2 | s16 | Width | Average width. 0 for the default. |
| 4 | 2 | s16 | Escapement | Angle of the text line, in tenths of a degree. |
| 6 | 2 | s16 | Orientation | Angle of each character. |
| 8 | 2 | s16 | Weight | 0 to 1000; 400 is normal and 700 is bold. |
| 10 | 1 | u8 | Italic | Boolean. |
| 11 | 1 | u8 | Underline | Boolean. |
| 12 | 1 | u8 | StrikeOut | Boolean. |
| 13 | 1 | u8 | CharSet | Character set. |
| 14 | 1 | u8 | OutPrecision | Output precision. |
| 15 | 1 | u8 | ClipPrecision | Clipping precision. |
| 16 | 1 | u8 | Quality | Output quality. |
| 17 | 1 | u8 | PitchAndFamily | Low bits: pitch. High bits: family. |
| 18 | varies | ASCII | Facename | Font name, zero-terminated, up to 32 bytes. |
Bitmap16 object
The device-dependent bitmap used by META_BITBLT and
META_STRETCHBLT: width, height, width in bytes, plane count, bits per
pixel, then the pixel bits, in that order. MS-WMF defines the Bitmap16 object with a 16-bit
Type field in front of these, while Wine’s playback code reads these records
without it, so check the offset against the record size.
Brush styles
| Value | Name | Meaning |
|---|---|---|
| 0 | BS_SOLID | One colour, solid or dithered. |
| 1 | BS_NULL | Paints nothing. |
| 2 | BS_HATCHED | A simple pattern over a solid background. |
| 3 | BS_PATTERN | Pattern from a bitmap. |
| 4 | BS_INDEXED | Not supported. |
| 5 | BS_DIBPATTERN | Pattern from a DIB. |
| 6 | BS_DIBPATTERNPT | Pattern from a DIB. |
| 7 | BS_PATTERN8X8 | Not supported. |
| 8 | BS_DIBPATTERN8X8 | Not supported. |
| 9 | BS_MONOPATTERN | Not supported. |
Hatch styles
| Value | Name |
|---|---|
| 0 | HS_HORIZONTAL |
| 1 | HS_VERTICAL |
| 2 | HS_FDIAGONAL |
| 3 | HS_BDIAGONAL |
| 4 | HS_CROSS |
| 5 | HS_DIAGCROSS |
Pen styles
A pen style is built by ORing one value from each of Style, End cap and Join.
| Value | Name | Group |
|---|---|---|
0x0000 | PS_SOLID | Style |
0x0001 | PS_DASH | Style |
0x0002 | PS_DOT | Style |
0x0003 | PS_DASHDOT | Style |
0x0004 | PS_DASHDOTDOT | Style |
0x0005 | PS_NULL | Style |
0x0006 | PS_INSIDEFRAME | Style |
0x0007 | PS_USERSTYLE | Style |
0x0008 | PS_ALTERNATE | Style |
0x0000 | PS_ENDCAP_ROUND | End cap |
0x0100 | PS_ENDCAP_SQUARE | End cap |
0x0200 | PS_ENDCAP_FLAT | End cap |
0x0000 | PS_JOIN_ROUND | Join |
0x1000 | PS_JOIN_BEVEL | Join |
0x2000 | PS_JOIN_MITER | Join |
Map modes
| Value | Name | One logical unit is |
|---|---|---|
| 1 | MM_TEXT | One device pixel, y increases downwards. |
| 2 | MM_LOMETRIC | 0.1 mm, y up. |
| 3 | MM_HIMETRIC | 0.01 mm, y up. |
| 4 | MM_LOENGLISH | 0.01 inch, y up. |
| 5 | MM_HIENGLISH | 0.001 inch, y up. |
| 6 | MM_TWIPS | 1/1440 inch, y up. |
| 7 | MM_ISOTROPIC | Arbitrary, with equal scale on both axes. |
| 8 | MM_ANISOTROPIC | Arbitrary, each axis scaled separately. |
Modes
| Field | Values |
|---|---|
MixMode | 1 TRANSPARENT, 2 OPAQUE |
PolyFillMode | 1 ALTERNATE, 2 WINDING |
StretchMode | 1 BLACKONWHITE, 2 WHITEONBLACK, 3 COLORONCOLOR, 4 HALFTONE |
ColorUsage | 0 DIB_RGB_COLORS, 1 DIB_PAL_COLORS |
FloodFill | 0 FLOODFILLBORDER, 1 FLOODFILLSURFACE |
| Compression (DIB) | 0 BI_RGB, 1 BI_RLE8, 2 BI_RLE4, 3 BI_BITFIELDS, 4 BI_JPEG, 5 BI_PNG |
ExtTextOutOptions | ETO_OPAQUE 0x0002, ETO_CLIPPED 0x0004, ETO_GLYPH_INDEX 0x0010, ETO_RTLREADING 0x0080, ETO_NUMERICSLOCAL 0x0400, ETO_NUMERICSLATIN 0x0800, ETO_PDY 0x2000 |
TextAlignmentMode | TA_NOUPDATECP 0x00, TA_UPDATECP 0x01, TA_LEFT 0x00, TA_RIGHT 0x02, TA_CENTER 0x06, TA_TOP 0x00, TA_BOTTOM 0x08, TA_BASELINE 0x18, TA_RTLREADING 0x100 |
VerticalTextAlignmentMode | VTA_TOP 0x00, VTA_RIGHT 0x00, VTA_BOTTOM 0x02, VTA_CENTER 0x06, VTA_LEFT 0x08, VTA_BASELINE 0x18 |
Binary raster operations
Stored with META_SETROP2. The expression is in reverse Polish notation,
where P is the pen and D the destination: a is AND, o is OR, x is XOR and n is NOT.
| Value | Name | Operation |
|---|---|---|
| 1 | R2_BLACK | 0 |
| 2 | R2_NOTMERGEPEN | DPon |
| 3 | R2_MASKNOTPEN | DPna |
| 4 | R2_NOTCOPYPEN | Pn |
| 5 | R2_MASKPENNOT | PDna |
| 6 | R2_NOT | Dn |
| 7 | R2_XORPEN | DPx |
| 8 | R2_NOTMASKPEN | DPan |
| 9 | R2_MASKPEN | DPa |
| 10 | R2_NOTXORPEN | DPxn |
| 11 | R2_NOP | D |
| 12 | R2_MERGENOTPEN | DPno |
| 13 | R2_COPYPEN | P |
| 14 | R2_MERGEPENNOT | PDno |
| 15 | R2_MERGEPEN | DPo |
| 16 | R2_WHITE | 1 |
Ternary raster operations
The bitmap and pattern records take a 32-bit code combining source, pattern and destination. MS-WMF lists all 256; the named common ones are:
| Value | Name | Value | Name |
|---|---|---|---|
0x00CC0020 | SRCCOPY | 0x00EE0086 | SRCPAINT |
0x008800C6 | SRCAND | 0x00660046 | SRCINVERT |
0x00440328 | SRCERASE | 0x00330008 | NOTSRCCOPY |
0x001100A6 | NOTSRCERASE | 0x00C000CA | MERGECOPY |
0x00BB0226 | MERGEPAINT | 0x00F00021 | PATCOPY |
0x00FB0A09 | PATPAINT | 0x005A0049 | PATINVERT |
0x00550009 | DSTINVERT | 0x00000042 | BLACKNESS |
0x00FF0062 | WHITENESS |
Font values
| Field | Values |
|---|---|
CharSet | 0 ANSI, 1 DEFAULT, 2 SYMBOL, 0x4D MAC, 0x80 SHIFTJIS, 0x81 HANGUL, 0x82 JOHAB, 0x86 GB2312, 0x88 CHINESEBIG5, 0xA1 GREEK, 0xA2 TURKISH, 0xA3 VIETNAMESE, 0xB1 HEBREW, 0xB2 ARABIC, 0xBA BALTIC, 0xCC RUSSIAN, 0xDE THAI, 0xEE EASTEUROPE, 0xFF OEM |
OutPrecision | 0 DEFAULT, 1 STRING, 2 CHARACTER, 3 STROKE, 4 TT, 5 DEVICE, 6 RASTER, 7 TT_ONLY, 8 OUTLINE, 9 SCREEN_OUTLINE, 10 PS_ONLY |
ClipPrecision | 0 DEFAULT, 1 CHARACTER, 2 STROKE, 0x10 LH_ANGLES, 0x20 TT_ALWAYS, 0x40 DFA_DISABLE, 0x80 EMBEDDED |
FontQuality | 0 DEFAULT, 1 DRAFT, 2 PROOF, 3 NONANTIALIASED, 4 ANTIALIASED, 5 CLEARTYPE, 6 CLEARTYPE_NATURAL |
| Pitch (low bits) | 0 DEFAULT_PITCH, 1 FIXED_PITCH, 2 VARIABLE_PITCH |
| Family (high bits) | 0x00 FF_DONTCARE, 0x10 FF_ROMAN, 0x20 FF_SWISS, 0x30 FF_MODERN, 0x40 FF_SCRIPT, 0x50 FF_DECORATIVE |
Escape functions
The EscapeFunction field of META_ESCAPE.
| Value | Name | Value | Name |
|---|---|---|---|
0x0001 | NEWFRAME | 0x0002 | ABORTDOC |
0x0003 | NEXTBAND | 0x0004 | SETCOLORTABLE |
0x0005 | GETCOLORTABLE | 0x0006 | FLUSHOUT |
0x0007 | DRAFTMODE | 0x0008 | QUERYESCSUPPORT |
0x0009 | SETABORTPROC | 0x000A | STARTDOC |
0x000B | ENDDOC | 0x000C | GETPHYSPAGESIZE |
0x000D | GETPRINTINGOFFSET | 0x000E | GETSCALINGFACTOR |
0x000F | META_ESCAPE_ENHANCED_METAFILE | 0x0010 | SETPENWIDTH |
0x0011 | SETCOPYCOUNT | 0x0012 | SETPAPERSOURCE |
0x0013 | PASSTHROUGH | 0x0014 | GETTECHNOLOGY |
0x0015 | SETLINECAP | 0x0016 | SETLINEJOIN |
0x0017 | SETMITERLIMIT | 0x0018 | BANDINFO |
0x0019 | DRAWPATTERNRECT | 0x001A | GETVECTORPENSIZE |
0x001B | GETVECTORBRUSHSIZE | 0x001C | ENABLEDUPLEX |
0x001D | GETSETPAPERBINS | 0x001E | GETSETPRINTORIENT |
0x001F | ENUMPAPERBINS | 0x0020 | SETDIBSCALING |
0x0021 | EPSPRINTING | 0x0022 | ENUMPAPERMETRICS |
0x0023 | GETSETPAPERMETRICS | 0x0025 | POSTSCRIPT_DATA |
0x0026 | POSTSCRIPT_IGNORE | 0x002A | GETDEVICEUNITS |
0x0100 | GETEXTENDEDTEXTMETRICS | 0x0102 | GETPAIRKERNTABLE |
0x0200 | EXTTEXTOUT | 0x0201 | GETFACENAME |
0x0202 | DOWNLOADFACE | 0x0801 | METAFILE_DRIVER |
0x0C01 | QUERYDIBSUPPORT | 0x1000 | BEGIN_PATH |
0x1001 | CLIP_TO_PATH | 0x1002 | END_PATH |
0x100E | OPENCHANNEL | 0x100F | DOWNLOADHEADER |
0x1010 | CLOSECHANNEL | 0x1013 | POSTSCRIPT_PASSTHROUGH |
0x1014 | ENCAPSULATED_POSTSCRIPT | 0x1015 | POSTSCRIPT_IDENTIFY |
0x1016 | POSTSCRIPT_INJECTION | 0x1017 | CHECKJPEGFORMAT |
0x1018 | CHECKPNGFORMAT | 0x1019 | GET_PS_FEATURESETTING |
0x101A | MXDC_ESCAPE | 0x11D8 | SPCLPASSTHROUGH2 |