all repos — openbox @ 01a6d810b6b35288410ed43819a940749d92362f

openbox fork - make it a bit more like ryudo

increase the reported font size when it has a shadow
Dana Jansens danakj@orodu.net
commit

01a6d810b6b35288410ed43819a940749d92362f

parent

2c01b1aa9ae32db7062afe7159c393978958323a

1 files changed, 5 insertions(+), 12 deletions(-)

jump to
M src/Font.ccsrc/Font.cc

@@ -262,7 +262,7 @@ XftDraw *draw = XftDrawCreate(_display, d, _screen->getVisual(),

_screen->getColormap()); assert(draw); -/* if (_shadow) { + if (_shadow) { XftColor c; c.color.red = 0; c.color.green = 0;

@@ -274,21 +274,14 @@

XftDrawStringUtf8(draw, &c, _xftfont, x + 1, _xftfont->ascent + y + 1, (XftChar8 *) string.c_str(), string.size()); } -*/ - + XftColor c; c.color.red = color.red() | color.red() << 8; c.color.green = color.green() | color.green() << 8; c.color.blue = color.blue() | color.blue() << 8; c.pixel = color.pixel(); + c.color.alpha = 0xff | 0xff << 8; // no transparency in BColor yet - if (_shadow) { - c.color.alpha = 0x66 | 0x66 << 8; // transparent shadow - XftDrawStringUtf8(draw, &c, _xftfont, x + 1, _xftfont->ascent + y + 1, - (XftChar8 *) string.c_str(), string.size()); - } - - c.color.alpha = 0xff | 0xff << 8; // no transparency in BColor yet XftDrawStringUtf8(draw, &c, _xftfont, x, _xftfont->ascent + y, (XftChar8 *) string.c_str(), string.size());

@@ -318,7 +311,7 @@ if (_xftfont) {

XGlyphInfo info; XftTextExtentsUtf8(_display, _xftfont, (XftChar8 *) string.c_str(), string.size(), &info); - return info.xOff; + return info.xOff + (_shadow ? 1 : 0); } #endif // XFT

@@ -337,7 +330,7 @@ assert(_valid);

#ifdef XFT if (_xftfont) - return _xftfont->height; + return _xftfont->height + (_shadow ? 1 : 0); #endif // XFT if (i18n.multibyte())