#ifdef XFT
BFont::BFont(Display *d, BScreen *screen, const string &family, int size,
- bool bold, bool italic, bool shadow, bool antialias) :
+ bool bold, bool italic, bool shadow, unsigned char offset,
+ unsigned char tint, bool antialias) :
_display(d),
_screen(screen),
_family(family),
_italic(italic),
_antialias(antialias),
_shadow(shadow),
+ _offset(offset),
+ _tint(tint),
_xftfont(0),
_font(0),
_fontset(0),
c.color.red = 0;
c.color.green = 0;
c.color.blue = 0;
- c.color.alpha = 0x40 | 0x40 << 8; // transparent shadow
+ c.color.alpha = _tint | _tint << 8; // transparent shadow
c.pixel = BlackPixel(_display, _screen->getScreenNumber());
#ifdef XFT_UTF8
#else
XftDrawString8(
#endif
- draw, &c, _xftfont, x + 1, _xftfont->ascent + y + 1,
- (XftChar8 *) string.c_str(), string.size());
+ draw, &c, _xftfont, x + _offset,
+ _xftfont->ascent + y + _offset, (XftChar8 *) string.c_str(),
+ string.size());
}
XftColor c;
#ifdef XFT
bool _antialias;
bool _shadow;
+ unsigned char _offset;
+ unsigned char _tint;
XftFont *_xftfont;
#ifdef XFT
// loads an Xft font
BFont(Display *d, BScreen *screen, const std::string &family, int size,
- bool bold, bool italic, bool shadow, bool antialias = True);
+ bool bold, bool italic, bool shadow, unsigned char offset,
+ unsigned char tint, bool antialias = True);
#endif
// loads a standard X font
BFont(Display *d, BScreen *screen, const std::string &xlfd);
bool bold = False;
bool italic = False;
bool dropShadow = False;
+
if (style.getValue(rbasename + "xft.flags", s)) {
if (s.find("bold") != string::npos)
bold = True;
dropShadow = True;
}
+ unsigned char offset = 1;
+ if (style.getValue(rbasename + "xft.shadow.offset", s)) {
+ offset = atoi(s.c_str()); //doesn't detect errors
+ if (offset > CHAR_MAX)
+ offset = 1;
+ }
+
+ unsigned char tint = 0x40;
+ if (style.getValue(rbasename + "xft.shadow.tint", s)) {
+ tint = atoi(s.c_str());
+ }
+
+
BFont *b = new BFont(blackbox->getXDisplay(), this, family, i, bold,
- italic, dropShadow, resource.aa_fonts);
+ italic, dropShadow, offset, tint, resource.aa_fonts);
if (b->valid())
return b;
else
if (needsPressed) {
texture = &(screen->getWindowStyle()->b_pressed);
- Pixmap pbutton = texture->render(frame.button_w, frame.button_w,
- pbutton);
- unsigned long pixel;
-
- if (!pbutton) {
- pixel = texture->color().pixel();
- if (needsPressed & 0x1)
- frame.pfbutton_pixel = pixel;
- if (needsPressed & 0x2)
- frame.pubutton_pixel = pixel;
- } else {
- if (needsPressed & 0x1)
- frame.pfbutton = pbutton;
- if (needsPressed & 0x2)
- frame.pubutton = pbutton;
+ if (needsPressed & 0x1) {
+ frame.pfbutton = texture->render(frame.button_w, frame.button_w,
+ frame.pfbutton);
+ if (! frame.pfbutton)
+ frame.pfbutton_pixel = texture->color().pixel();
+ }
+ if (needsPressed & 0x2) {
+ frame.pubutton = texture->render(frame.button_w, frame.button_w,
+ frame.pubutton);
+ if (! frame.pubutton)
+ frame.pubutton = texture->color().pixel();
}
}