You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// DEFAULT_CHARSET: Specifies a character set based on the current system locale; for example, when the system locale is United States English, the default character set is ANSI_CHARSET.
71
+
or CharacterSet.DEFAULT_CHARSET=>1252,
72
+
CharacterSet.OEM_CHARSET=>437,
73
+
CharacterSet.SHIFTJIS_CHARSET=>932,
74
+
CharacterSet.HANGUL_CHARSET=>949,
75
+
CharacterSet.JOHAB_CHARSET=>1361,
76
+
CharacterSet.GB2312_CHARSET=>936,
77
+
CharacterSet.CHINESEBIG5_CHARSET=>950,
78
+
CharacterSet.HEBREW_CHARSET=>1255,
79
+
CharacterSet.ARABIC_CHARSET=>1256,
80
+
CharacterSet.GREEK_CHARSET=>1253,
81
+
CharacterSet.TURKISH_CHARSET=>1254,
82
+
CharacterSet.BALTIC_CHARSET=>1257,
83
+
CharacterSet.EASTEUROPE_CHARSET=>1250,
84
+
CharacterSet.RUSSIAN_CHARSET=>1251,
85
+
CharacterSet.THAI_CHARSET=>874,
86
+
CharacterSet.VIETNAMESE_CHARSET=>1258,
87
+
CharacterSet.SYMBOL_CHARSET=>42,// Symbol font is not a code page, but 42 is often used for Symbol font
88
+
_ =>1252,
89
+
};
90
+
91
+
returnEncoding.GetEncoding(codePageId);
92
+
}
93
+
94
+
floatlastDxOffset=0;
95
+
96
+
boolisItalic=false;
97
+
intfontWeight=400;
98
+
99
+
for(vari=0;i<wmfDocument.Records.Count;i++)
100
+
{
101
+
varwmfDocumentRecord=wmfDocument.Records[i];
102
+
switch(wmfDocumentRecord)
103
+
{
104
+
// The META_SETBKMODE Record defines the background raster operation mix mode in the playback device context. The background mix mode is the mode for combining pens, text, hatched brushes, and interiors of filled objects with background colors on the output surface.
105
+
caseWmfSetBkModeRecordsetBkModeRecord:
106
+
{
107
+
// RecordFunction (2 bytes): A 16-bit unsigned integer that defines this WMF record type. The lower byte MUST match the lower byte of the RecordType Enumeration (section 2.1.1.1) table value META_SETBKMODE.
108
+
// BkMode (2 bytes): A 16-bit unsigned integer that defines background mix mode. This MUST be one of the values in the MixMode Enumeration (section 2.1.1.20).
109
+
110
+
break;
111
+
}
112
+
caseWmfSetTextAlignRecordsetTextAlignRecord:
113
+
{
114
+
// RecordFunction (2 bytes): A 16-bit unsigned integer that defines this WMF record type. The lower byte MUST match the lower byte of the RecordType Enumeration (section 2.1.1.1) table value META_SETTEXTALIGN.
115
+
// TextAlignmentMode (2 bytes): A 16-bit unsigned integer that defines text alignment. This value MUST be a combination of one or more TextAlignmentMode Flags (section 2.1.2.3) for text with a horizontal baseline, and VerticalTextAlignmentMode Flags (section 2.1.2.4) for text with a vertical baseline.
// Width (2 bytes): A 16-bit signed integer that defines the average width, in logical units, of characters in the font. If Width is 0x0000, the aspect ratio of the device SHOULD be matched against the digitization aspect ratio of the available fonts to find the closest match, determined by the absolute value of the difference.
192
+
varfontWidth=createFontIndirectRecord.Width;
193
+
194
+
// Height (2 bytes): A 16-bit signed integer that specifies the height, in logical units, of the font's character cell. The character height is computed as the character cell height minus the internal leading. The font mapper SHOULD interpret the height as follows.
195
+
// value < 0x0000 The font mapper SHOULD transform this value into device units and match its absolute value against the character height of available fonts.
196
+
// 0x0000 A default height value MUST be used when creating a physical font.
197
+
// 0x0000 < value The font mapper SHOULD transform this value into device units and match it against the cell height of available fonts.
198
+
// For all height comparisons, the font mapper SHOULD find the largest physical font that does not exceed the requested size.<40>
199
+
// <40> Section 2.2.1.2: All Windows versions: mapping the logical font size to the available physical fonts occurs the first time the logical font needs to be used in a drawing operation.
200
+
// For the MM_TEXT mapping mode, the following formula can be used to compute the height of a font with a specified point size.
// Rectangle (8 bytes): An optional 8-byte Rect Object (section 2.2.2.18).) When either ETO_CLIPPED, ETO_OPAQUE, or both are specified, the rectangle defines the dimensions, in logical coordinates, used for clipping, opaquing, or both. When neither ETO_CLIPPED nor ETO_OPAQUE is specified, the coordinates in Rectangle are ignored.
235
+
varst=8;/*2byte ofr ty tx stringLength fwOpts*/
236
+
if(fwOptsisExtTextOutOptions.ETO_CLIPPED or ExtTextOutOptions.ETO_OPAQUE)
237
+
{
238
+
// 此时才有 Rectangle 的值
239
+
binaryReader.ReadBytes(8);
240
+
st+=8;
241
+
}
242
+
243
+
st+=stringLength;
244
+
245
+
// String (variable): A variable-length string that specifies the text to be drawn. The string does not need to be null-terminated, because StringLength specifies the length of the string. If the length is odd, an extra byte is placed after it so that the following member (optional Dx) is aligned on a 16-bit boundary. The string will be decoded based on the font object currently selected into the playback device context. If a font matching the font object’s specification is not found, the decoding is undefined. If a matching font is found that matches the charset specified in the font object, the string should be decoded with the codepages in the following table.
// Dx (variable): An optional array of 16-bit signed integers that indicate the distance between origins of adjacent character cells. For example, Dx[i] logical units separate the origins of character cell i and character cell i + 1. If this field is present, there MUST be the same number of values as there are characters in the string.
// 如果这里计算出来不是偶数,则首个需要跳过。这是经过测试验证的。~~但没有相关说明内容。且跳过的 byte 是有内容的~~ String (variable): If the length is odd, an extra byte is placed after it so that the following member (optional Dx) is aligned on a 16-bit boundary.
0 commit comments