issues with font metrics in X11

git-svn-id: svn://ultimatepp.org/upp/trunk@6574 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-11-18 19:23:42 +00:00
parent bd9522418b
commit ff04f27147
7 changed files with 45 additions and 29 deletions

View file

@ -228,20 +228,22 @@ void SystemDraw::DrawTextOp(int x, int y, int angle, const wchar *text, Font fon
}
}
else {
if(dx) {
// if(dx) {
DLOG("------------");
int xpos = ox;
Buffer<XftCharSpec> ch(n);
for(int i = 0; i < n; i++) {
ch[i].ucs4 = text[i];
ch[i].x = xpos;
ch[i].y = oy + ascent;
xpos += dx[i];
DLOG((char)text[i] << ", " << font[text[i]] << ", " << xpos);
xpos += dx ? dx[i] : font[text[i]];
}
XftDrawCharSpec(xftdraw, &c, xftfont, ch, n);
}
else
XftDrawString16(xftdraw, &c, xftfont, ox, oy + ascent,
(FcChar16 *)text, n);
// }
// else
// XftDrawString16(xftdraw, &c, xftfont, ox, oy + ascent,
// (FcChar16 *)text, n);
LLOG("XftColor: r=" << c.color.red << ", g=" << c.color.green << ", b=" << c.color.blue
<< ", alpha=" << c.color.alpha << ", pixel=" << FormatIntHex(c.pixel));
if(font.IsUnderline() || font.IsStrikeout()) {