X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FFont.cc;h=37dfef2f878f8e94bf1047bd48bce5f52479baf0;hb=2c01b1aa9ae32db7062afe7159c393978958323a;hp=bc4f6440e5b0fe694903d10c18cc21c4eff1eefb;hpb=235d9e4c4033157c0a4a1ba866664c4b75a33b82;p=chaz%2Fopenbox diff --git a/src/Font.cc b/src/Font.cc index bc4f6440..37dfef2f 100644 --- a/src/Font.cc +++ b/src/Font.cc @@ -48,7 +48,7 @@ string BFont::_fallback_font = "fixed"; #ifdef XFT BFont::BFont(Display *d, BScreen *screen, const string &family, int size, - bool bold, bool italic, bool antialias) : + bool bold, bool italic, bool shadow, bool antialias) : _display(d), _screen(screen), _family(family), @@ -57,6 +57,7 @@ BFont::BFont(Display *d, BScreen *screen, const string &family, int size, _bold(bold), _italic(italic), _antialias(antialias), + _shadow(shadow), _xftfont(0), _font(0), _fontset(0), @@ -91,6 +92,7 @@ BFont::BFont(Display *d, BScreen *screen, const string &xlfd) : _screen(screen), #ifdef XFT _antialias(False), + _shadow(False), _xftfont(0), #endif // XFT _font(0), @@ -260,13 +262,33 @@ void BFont::drawString(Drawable d, int x, int y, const BColor &color, _screen->getColormap()); assert(draw); +/* if (_shadow) { + XftColor c; + c.color.red = 0; + c.color.green = 0; + c.color.blue = 0; + c.color.alpha = 0x49 | 0x49 << 8; // transparent shadow + c.pixel = BlackPixel(_display, _screen->getScreenNumber()); + + + 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.color.alpha = 0xff | 0xff << 8; // no transparency in BColor yet c.pixel = color.pixel(); + + 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());