Draw: Numerous fixes

git-svn-id: svn://ultimatepp.org/upp/trunk@1473 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-08-04 11:50:18 +00:00
parent cf0af7d760
commit 90bf24af9c
5 changed files with 51 additions and 60 deletions

View file

@ -105,7 +105,7 @@ int Paragraph::GetWidth(int zoom) const {
const char *s = pptr->text;
int n = pptr->text.GetLength();
while(n--) {
cx += pf[*s == 31 ? 32 : (byte) *s];
cx += pf[*s == 31 ? 32 : ToUnicode((byte) *s, CHARSET_DEFAULT)];
s++;
}
}
@ -165,11 +165,10 @@ bool Paragraph::Format(ParaTypo& pfmt, int cx, int zoom) const {
font.Height(DocZoom(zoom, pptr->font.GetHeight()));
FontInfo pf = pp->Set(font, pptr->color);
const char *s = pptr->text;
// LOG("Format " << s << " a: " << pf.GetAscent() << " d: " << pf.GetDescent());
int n = pptr->text.GetLength();
while(n--) {
*cp++ = *s;
*wp++ = pf[*s == 31 ? 32 : (byte) *s];
*wp++ = pf[*s == 31 ? 32 : ToUnicode((byte) *s, CHARSET_DEFAULT)];
*ip++ = pp;
s++;
}