次の方法で共有


2.3.4.6 EmfPlusDrawDriverString Record

The EmfPlusDrawDriverString record specifies text output with character positions.


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

DriverStringOptionsFlags

MatrixPresent

GlyphCount

Glyphs (variable)

...

GlyphPos (variable)

...

TransformMatrix (24 bytes, optional)

...

...

...

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

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 the color value in an EmfPlusARGB object. If clear, BrushId contains the EMF+ Object Table index of an EmfPlusBrush object.

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

ObjectID (1 byte): The EMF+ Object Table index of an EmfPlusFont object 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 and record-specific data.

Value

Meaning

0x0000001C ≤ value

When glyphs are provided, but no transform matrix is specified in the TransformMatrix field, the size of the record is computed as follows:

 Size   = (GlyphCount * 0x0000000A) + 0x0000001C

0x00000034 ≤ value

When glyphs are provided, and a transform matrix is specified in the TransformMatrix field, the size of the record is computed as follows:

 Size   = (GlyphCount * 0x0000000A) + 0x00000034

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

Value

Meaning

0x00000010 ≤ value

When glyphs are provided, but no transform matrix is specified in the TransformMatrix field, the size of the data is computed as follows:

 DataSize   = (GlyphCount * 0x0000000A) + 0x00000010

0x00000028 ≤ value

When glyphs are provided, and a transform matrix is specified in the TransformMatrix field, the size of the data is computed as follows:

 DataSize   = (GlyphCount * 0x0000000A) + 0x00000028

BrushId (4 bytes): An unsigned integer that specifies either the foreground color of the text or a graphics brush, depending on the value of the S flag in the Flags.

DriverStringOptionsFlags (4 bytes): An unsigned integer that specifies the spacing, orientation, and quality of rendering for the string. This value MUST be composed of DriverStringOptions flags.

MatrixPresent (4 bytes): An unsigned integer that specifies whether a transform matrix is present in the TransformMatrix field.

Value

Meaning

0x00000000

The transform matrix is not present in the record.

0x00000001

The transform matrix is present in the record.

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

Glyphs (variable): An array of 16-bit values that define the text string to draw.

If the DriverStringOptionsCmapLookup flag in the DriverStringOptionsFlags field is set, each value in this array specifies a Unicode character. Otherwise, each value specifies an index to a character glyph in the EmfPlusFont object specified by the ObjectId value in Flags field.

GlyphPos (variable): An array of EmfPlusPointF objects that specify the output position of each character glyph. There MUST be GlyphCount elements, which have a one-to-one correspondence with the elements in the Glyphs array.

Glyph positions are calculated from the position of the first glyph if the DriverStringOptionsRealizedAdvance flag in DriverStringOptions flags is set. In this case, GlyphPos specifies the position of the first glyph only.

TransformMatrix (24 bytes): An optional EmfPlusTransformMatrix object that specifies the transformation to apply to each value in the text array. The presence of this data is determined from the MatrixPresent field.

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