aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/XftFontImp.hh
diff options
context:
space:
mode:
authorsimonb <simonb>2006-03-26 04:02:30 (GMT)
committersimonb <simonb>2006-03-26 04:02:30 (GMT)
commitaf74a2284551c8511b66d77112c7bf32831c1522 (patch)
tree35a8830352f5facc1fc9c58b82c0c6dce8fc921e /src/FbTk/XftFontImp.hh
parent872f6a0e1e4230f702ad69fa2d7e10a2fa78b7a3 (diff)
downloadfluxbox-af74a2284551c8511b66d77112c7bf32831c1522.zip
fluxbox-af74a2284551c8511b66d77112c7bf32831c1522.tar.bz2
rotated fonts, buttons, containers. Used for tabs for now
Diffstat (limited to 'src/FbTk/XftFontImp.hh')
-rw-r--r--src/FbTk/XftFontImp.hh18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/FbTk/XftFontImp.hh b/src/FbTk/XftFontImp.hh
index 21a80b6..f660303 100644
--- a/src/FbTk/XftFontImp.hh
+++ b/src/FbTk/XftFontImp.hh
@@ -26,6 +26,7 @@
26 26
27#include <X11/Xft/Xft.h> 27#include <X11/Xft/Xft.h>
28#include "FontImp.hh" 28#include "FontImp.hh"
29#include <string>
29 30
30namespace FbTk { 31namespace FbTk {
31 32
@@ -35,16 +36,23 @@ public:
35 XftFontImp(const char *fontname, bool utf8); 36 XftFontImp(const char *fontname, bool utf8);
36 ~XftFontImp(); 37 ~XftFontImp();
37 bool load(const std::string &name); 38 bool load(const std::string &name);
38 void drawText(const FbDrawable &w, int screen, GC gc, const char *text, size_t len, int x, int y) const; 39 void drawText(const FbDrawable &w, int screen, GC gc, const char *text, size_t len, int x, int y , FbTk::Orientation orient) const;
39 unsigned int textWidth(const char * const text, unsigned int len) const; 40 unsigned int textWidth(const char * const text, unsigned int len) const;
40 unsigned int height() const; 41 unsigned int height() const;
41 int ascent() const { return m_xftfont ? m_xftfont->ascent : 0; } 42 int ascent() const { return m_xftfonts[0] ? m_xftfonts[0]->ascent : 0; }
42 int descent() const { return m_xftfont ? m_xftfont->descent : 0; } 43 int descent() const { return m_xftfonts[0] ? m_xftfonts[0]->descent : 0; }
43 bool loaded() const { return m_xftfont != 0; } 44 bool loaded() const { return m_xftfonts[0] != 0; }
44 bool utf8() const { return m_utf8mode; } 45 bool utf8() const { return m_utf8mode; }
46 bool validOrientation(FbTk::Orientation orient);
47
45private: 48private:
46 XftFont *m_xftfont; 49 XftFont *m_xftfonts[4]; // 4 possible orientations
50 // rotated xft fonts don't give proper extents info, so we keep the "real"
51 // one around for it
47 bool m_utf8mode; 52 bool m_utf8mode;
53
54 std::string m_name;
55 int m_angle;
48}; 56};
49 57
50} // end namespace FbTk 58} // end namespace FbTk