diff options
Diffstat (limited to 'src/FbTk/XftFontImp.hh')
-rw-r--r-- | src/FbTk/XftFontImp.hh | 18 |
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 | ||
30 | namespace FbTk { | 31 | namespace 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 | |||
45 | private: | 48 | private: |
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 |