*Draw: fixed CJK glyph issues

git-svn-id: svn://ultimatepp.org/upp/trunk@3417 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2011-05-13 10:21:59 +00:00
parent f8fc27de41
commit 2fbbc9989d
3 changed files with 46 additions and 32 deletions

View file

@ -85,6 +85,19 @@ void Draw::DrawText(int x, int y, int angle, const wchar *text, Font font,
}
GlyphMetrics(gi, font, chr);
}
else {
Font fnt = Arial(font.GetHeight());
wchar chr = 0x25a1;
gi = GetGlyphInfo(fnt, chr);
if(!gi.IsNormal()) {
chr = ' ';
gi = GetGlyphInfo(fnt, chr);
}
if(angle)
DrawTextOp(int(x + cosa * d), int(y - sina * d), angle, &chr, fnt, ink, 1, NULL);
else
DrawTextOp(x + d, y, 0, &chr, fnt, ink, 1, NULL);
}
d += dx ? *dx++ : gi.width;
}
}