#include "GCCache.hh"
#include "Color.hh"
-bool BFont::_antialias = True;
string BFont::_fallback_font = "fixed";
-
#ifdef XFT
BFont::BFont(Display *d, BScreen *screen, const string &family, int size,
- bool bold, bool italic) : _display(d),
- _screen(screen),
- _family(family),
- _simplename(False),
- _size(size),
- _bold(bold),
- _italic(italic),
- _xftfont(0),
- _font(0),
- _fontset(0),
- _fontset_extents(0) {
+ bool bold, bool italic, bool antialias) :
+ _display(d),
+ _screen(screen),
+ _family(family),
+ _simplename(False),
+ _size(size),
+ _bold(bold),
+ _italic(italic),
+ _antialias(antialias),
+ _xftfont(0),
+ _font(0),
+ _fontset(0),
+ _fontset_extents(0) {
_valid = False;
_xftfont = XftFontOpen(_display, _screen->getScreenNumber(),
_display(d),
_screen(screen),
#ifdef XFT
+ _antialias(False),
_xftfont(0),
#endif // XFT
_font(0),
* static members
*/
private:
- static bool _antialias;
static std::string _fallback_font;
public:
- inline static bool antialias(void) { return _antialias; }
- inline static void setAntialias(bool a) { _antialias = a; }
-
// the fallback is only used for X fonts, not for Xft fonts, since it is
// assumed that X fonts will be the fallback from Xft.
inline static std::string fallbackFont(void) { return _fallback_font; }
bool _italic;
#ifdef XFT
+ bool _antialias;
+
XftFont *_xftfont;
bool createXftFont(void);
#ifdef XFT
// loads an Xft font
BFont(Display *d, BScreen *screen, const std::string &family, int size,
- bool bold, bool italic);
+ bool bold, bool italic, bool antialias = True);
#endif
// loads a standard X font
BFont(Display *d, BScreen *screen, const std::string &xlfd);
}
+void BScreen::saveAAFonts(bool f) {
+ resource.aa_fonts = f;
+ reconfigure();
+ config->setValue(screenstr + "antialiasFonts", resource.aa_fonts);
+}
+
+
void BScreen::saveHideToolbar(bool h) {
resource.hide_toolbar = h;
if (resource.hide_toolbar)
saveSloppyFocus(resource.sloppy_focus);
saveAutoRaise(resource.auto_raise);
saveImageDither(doImageDither());
+ saveAAFonts(resource.aa_fonts);
saveOpaqueMove(resource.opaque_move);
saveFullMax(resource.full_max);
saveFocusNew(resource.focus_new);
if (! config->getValue(screenstr + "opaqueMove", resource.opaque_move))
resource.opaque_move = false;
+ if (! config->getValue(screenstr + "antialiasFonts", resource.aa_fonts))
+ resource.aa_fonts = true;
+
if (! config->getValue(screenstr + "hideToolbar", resource.hide_toolbar))
resource.hide_toolbar = false;
}
BFont *b = new BFont(blackbox->getXDisplay(), this, family, i, bold,
- italic);
+ italic, resource.aa_fonts);
if (b->valid())
return b;
else
extern "C" {
#include <X11/Xlib.h>
-#include <X11/Xresource.h>
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
bool sloppy_focus, auto_raise, auto_edge_balance, ordered_dither,
opaque_move, full_max, focus_new, focus_last, click_raise,
- hide_toolbar, window_to_window_snap, window_corner_snap;
+ hide_toolbar, window_to_window_snap, window_corner_snap, aa_fonts;
BColor border_color;
unsigned int workspaces;
inline bool doAutoRaise(void) const { return resource.auto_raise; }
inline bool doClickRaise(void) const { return resource.click_raise; }
inline bool isScreenManaged(void) const { return managed; }
+ inline bool doAAFonts(void) const { return resource.aa_fonts; }
inline bool doImageDither(void) const { return image_control->doDither(); }
inline bool doOrderedDither(void) const { return resource.ordered_dither; }
inline bool doOpaqueMove(void) const { return resource.opaque_move; }
void saveColPlacementDirection(int d);
void saveEdgeSnapThreshold(int t);
void saveImageDither(bool d);
+ void saveAAFonts(bool f);
void saveOpaqueMove(bool o);
void saveFullMax(bool f);
void saveFocusNew(bool f);