1 // -*- mode: C++; indent-tabs-mode: nil; -*-
7 #define _XFT_NO_COMPAT_ // no Xft 1 API
8 #include <X11/Xft/Xft.h>
26 static std::string _fallback_font;
27 static bool _xft_init;
30 // the fallback is only used for X fonts, not for Xft fonts, since it is
31 // assumed that X fonts will be the fallback from Xft.
32 inline static std::string fallbackFont(void) { return _fallback_font; }
33 inline static void setFallbackFont(const std::string &f)
34 { _fallback_font = f; }
42 std::string _fontstring;
45 unsigned char _offset;
50 bool createXftFont(void);
54 BFont(int screen_num, const std::string &fontstring, bool shadow,
55 unsigned char offset, unsigned char tint);
58 inline const std::string &fontstring() const { return _fontstring; }
60 unsigned int height() const;
61 unsigned int maxCharWidth() const;
63 unsigned int measureString(const std::string &string,
64 bool utf8 = false) const;
66 //! Draws a string into an XftDraw object
68 Be Warned: If you use an XftDraw object and a color, or a font from
69 different screens, you WILL have unpredictable results! :)
71 void drawString(XftDraw *d, int x, int y, const BColor &color,
72 const std::string &string, bool utf8 = false) const;