--- rxvt-unicode/src/defaultfont.h 2003/11/24 17:31:27 1.2 +++ rxvt-unicode/src/defaultfont.h 2004/01/17 01:20:01 1.9 @@ -1,9 +1,5 @@ -/* - * $Id: defaultfont.h,v 1.2 2003/11/24 17:31:27 pcg Exp $ - */ - -#ifndef _DEFAULTFONT_H_ -#define _DEFAULTFONT_H_ +#ifndef DEFAULTFONT_H_ +#define DEFAULTFONT_H_ #ifdef HAVE_XSETLOCALE # define X_LOCALE @@ -21,26 +17,28 @@ #include "rxvtlib.h" #include "feature.h" #include "encoding.h" -#include "rxvtvec.h" - -#include "defaultfont.intpro" /* PROTOS for internal routines */ +#include "rxvtstl.h" -typedef struct rxvt_vars rxvt_t; +struct rxvt_fontprop { + enum { + medium = 100, bold = 200, + roman = 0, italic = 100, + }; + int width, height; + int weight, slant; +}; struct rxvt_font { // managed by the fontset -#if EXPLICIT_CONTEXT - rxvt_t *rxvt_term; - void set_term (pR) { this->rxvt_term = R; } -#else - void set_term (pR) { } -#endif + rxvt_t r; + void set_term (rxvt_t r) { this->r = r; } + char *name; codeset cs; - bool loaded; + bool loaded; // wether we tried loading it before (not wether it's loaded) // managed by the font object - bool prop; // wether this is a proportional font or has other funny characteristics + bool slow; // wether this is a proportional font or has other funny characteristics int ascent, descent, width, height; @@ -57,7 +55,9 @@ virtual void clear () { }; - virtual bool load (int maxheight) = 0; + virtual rxvt_fontprop properties () = 0; + + virtual bool load (const rxvt_fontprop &prop) = 0; virtual bool has_codepoint (uint32_t unicode) = 0; virtual void draw (int x, int y, @@ -72,7 +72,7 @@ struct rxvt_fallback_font; struct rxvt_fontset { - rxvt_fontset (pR); + rxvt_fontset (rxvt_t r); ~rxvt_fontset (); rxvt_font *new_font (const char *name, codeset cs); @@ -91,13 +91,11 @@ } private: -#ifdef EXPLICIT_CONTEXT - rxvt_t *rxvt_term; -#endif + rxvt_t r; simplevec fonts; const rxvt_fallback_font *fallback; - int height; + rxvt_fontprop base_prop; int base_id; bool realize_font (int i);