2.3.4.14 EmfPlusDrawString Record

The EmfPlusDrawString record specifies text output with string formatting.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

Type

Flags

Size

DataSize

BrushId

FormatID

Length

LayoutRect

...

...

...

StringData (variable)

...

AlignmentPadding (variable)

...

Type (2 bytes): An unsigned integer that identifies this record type as EmfPlusDrawString from the RecordType enumeration. The value MUST be 0x401C.

Flags (2 bytes): An unsigned integer that provides information about how the operation is to be performed, and about the structure of the record.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

S

X

X

X

X

X

X

X

ObjectID

S (1 bit): This bit indicates the type of data in the BrushId field.

If set, BrushId specifies a color as an EmfPlusARGB object. If clear, BrushId contains the index of an EmfPlusBrush object in the EMF+ Object Table.

X (1 bit): Reserved and MUST be ignored.

ObjectID (1 byte): The index of an EmfPlusFont object in the EMF+ Object Table to render the text. The value MUST be zero to 63, inclusive.

Size (4 bytes): An unsigned integer that specifies the 32-bit-aligned number of bytes in the entire record, including the 12-byte record header, record-specific data, and any extra alignment padding.

Value

Meaning

0x0000002A ≤ value

The size of the record is computed as follows:

 Size   = (Length * 0x00000002) + 0x00000028 (+ AlignmentPaddingSize where   AlignmentPaddingSize is the number of bytes in AlignmentPadding)

DataSize (4 bytes): An unsigned integer that specifies the 32-bit-aligned number of bytes of record-specific data and any extra alignment padding that follows.

Value

Meaning

0x0000001E ≤ value

The size of the data is computed as follows:

 DataSize   = (Length * 0x00000002) + 0x0000001C (+ AlignmentPaddingSize where   AlignmentPaddingSize is the number of bytes in AlignmentPadding)

BrushId (4 bytes): An unsigned integer that specifies the brush, the content of which is determined by the S bit in the Flags field. This definition is used to paint the foreground text color; that is, just the glyphs themselves.

FormatID (4 bytes): An unsigned integer that specifies the index of an optional EmfPlusStringFormat object in the EMF+ Object Table. This object specifies text layout information and display manipulations to be applied to a string.

Length (4 bytes): An unsigned integer that specifies the number of characters in the string.

LayoutRect (16 bytes): An EmfPlusRectF object that defines the bounding area of the destination that will receive the string.

StringData (variable): An array of 16-bit Unicode characters that specifies the string to be drawn.

AlignmentPadding (variable): An optional array of up to 3 bytes that pads the record-specific data so that DataSize is a multiple of 4 bytes. This field MUST be ignored.

See section 2.3.4 for the specification of additional drawing record types.