Skip to content

Commit 0ddf78d

Browse files
committed
修复文本颜色
1 parent 373d303 commit 0ddf78d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • Workbench/Wmf/KawkaywecaljalKayjaybelfuber

Workbench/Wmf/KawkaywecaljalKayjaybelfuber/Program.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Encoding CharacterSetToEncoding(CharacterSet characterSet)
155155
//
156156
case WmfSetTextColorRecord setTextColorRecord:
157157
{
158-
currentPenColor = ToSKColor(setTextColorRecord.Color);
158+
currentTextColor = ToSKColor(setTextColorRecord.Color);
159159

160160
break;
161161
}
@@ -240,6 +240,7 @@ Encoding CharacterSetToEncoding(CharacterSet characterSet)
240240
skFont.Size = currentFontSize;
241241
skFont.Typeface = SKTypeface.FromFamilyName(currentFontName);
242242
paint.Style = SKPaintStyle.Fill;
243+
paint.Color = currentTextColor;
243244

244245
var currentXOffset = currentX + tx + lastXOffset;
245246

@@ -250,7 +251,7 @@ Encoding CharacterSetToEncoding(CharacterSet characterSet)
250251
else
251252
{
252253
// 如果这里计算出来不是偶数,则首个需要跳过。这是经过测试验证的。但没有相关说明内容。且跳过的 byte 是有内容的
253-
if (dxLength % sizeof(UInt16) == 1)
254+
if (dxLength > ((dxLength / sizeof(UInt16)) * sizeof(UInt16)))
254255
{
255256
var r = binaryReader.ReadByte();
256257
_ = r;

0 commit comments

Comments
 (0)