--- rxvt-unicode/src/rxvtfont.h 2004/08/25 05:03:33 1.12 +++ rxvt-unicode/src/rxvtfont.h 2006/02/18 14:14:43 1.21 @@ -34,37 +34,14 @@ medium = 100, bold = 200, roman = 0, italic = 100, }; - int width, height; + int width, height, ascent; int weight, slant; }; -struct rxvt_drawable { - rxvt_display *display; - Drawable drawable; -#if XFT - XftDraw *xftdrawable; - operator XftDraw *(); -#endif - - rxvt_drawable (rxvt_display *display, Drawable drawable) - : display(display), -#if XFT - xftdrawable(0), -#endif - drawable(drawable) - { } - -#if XFT - ~rxvt_drawable (); -#endif - - operator Drawable() { return drawable; } -}; - struct rxvt_font { // managed by the fontset - rxvt_term *r; - void set_term (rxvt_term *r) { this->r = r; } + rxvt_term *term; + void set_term (rxvt_term *term) { this->term = term; } char *name; codeset cs; @@ -76,17 +53,17 @@ void set_name (char *name); - rxvt_font () { name = 0; } + rxvt_font (); virtual ~rxvt_font () { free (name); }; virtual void clear () { }; - void clear_rect (rxvt_drawable &d, int x, int y, int w, int h, int color); + void clear_rect (rxvt_drawable &d, int x, int y, int w, int h, int color) const; virtual rxvt_fontprop properties () = 0; virtual bool load (const rxvt_fontprop &morph) = 0; - virtual bool has_char (uint32_t unicode, const rxvt_fontprop *prop, bool &careful) = 0; + virtual bool has_char (uint32_t unicode, const rxvt_fontprop *prop, bool &careful) const = 0; virtual void draw (rxvt_drawable &d, int x, int y, @@ -100,14 +77,12 @@ struct rxvt_fontset { char *fontdesc; - rxvt_fontprop prop; - rxvt_fontset (rxvt_term *r); + rxvt_fontset (rxvt_term *term); ~rxvt_fontset (); - rxvt_font *new_font (const char *name, codeset cs); - - bool populate (const char *desc, const rxvt_fontprop &prop); + bool populate (const char *desc); + void set_prop (const rxvt_fontprop &prop) { this->prop = prop; } int find_font (uint32_t unicode); int find_font (const char *name) const; bool realize_font (int i); @@ -119,15 +94,17 @@ } private: - rxvt_term *r; + rxvt_term *term; + rxvt_fontprop prop; simplevec fonts; const rxvt_fallback_font *fallback; typedef unsigned char pagemap[256]; vector fmap; - void add_fonts (const char *desc); void clear (); + rxvt_font *new_font (const char *name, codeset cs); + void add_fonts (const char *desc); }; #endif /* _DEFAULTFONT_H_ */