xftfont.h (844B)
1 // Copyright (c) 2003 - 2009 Anselm R Garbe <anselm@garbe.us> 2 // See LICENSE for license details. 3 4 #ifndef __XFTFONT_H 5 #define __XFTFONT_H 6 7 #include "wmi.h" 8 9 #ifdef XFT_SUPPORT 10 11 extern "C" { 12 #include <X11/Xft/Xft.h> 13 } 14 15 #include <string> 16 17 #include "font.h" 18 19 class Monitor; 20 21 /** Base class for XftFonts. */ 22 class WXftFont : public WFont { 23 24 public: 25 26 WXftFont(Monitor *monitor, XftFont *font); 27 virtual ~WXftFont(); 28 29 virtual void drawText(Window window, GC gc, int x, int y, string text); 30 31 virtual int textWidth(string text); 32 33 virtual unsigned int height(); 34 35 virtual void setHeight(unsigned int height); 36 37 virtual int ascent(); 38 39 virtual int descent(); 40 41 static WXftFont *load(Monitor *monitor, string name); 42 43 private: 44 45 XftFont *font_; 46 unsigned int height_; 47 48 }; 49 50 #endif // XFT_SUPPORT 51 52 #endif // __XFTFONT_H