1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
7 #define _XFT_NO_COMPAT_ // no Xft 1 API
8 #include <X11/Xft/Xft.h>
23 static std::string _fallback_font;
24 static bool _xft_init;
27 // the fallback is only used for X fonts, not for Xft fonts, since it is
28 // assumed that X fonts will be the fallback from Xft.
29 inline static std::string fallbackFont(void) { return _fallback_font; }
30 inline static void setFallbackFont(const std::string &f)
31 { _fallback_font = f; }
39 std::string _fontstring;
42 unsigned char _offset;
47 bool createXftFont(void);
51 Font(int screen_num, const std::string &fontstring, bool shadow,
52 unsigned char offset, unsigned char tint);
55 inline const std::string &fontstring() const { return _fontstring; }
57 unsigned int height() const;
58 unsigned int maxCharWidth() const;
60 unsigned int measureString(const std::string &string,
61 bool utf8 = true) const;
63 //! Draws a string into an XftDraw object
65 Be Warned: If you use an XftDraw object and a color, or a font from
66 different screens, you WILL have unpredictable results! :)
68 void drawString(XftDraw *d, int x, int y, const Color &color,
69 const std::string &string, bool utf8 = true) const;