--- rxvt-unicode/src/defaultfont.h 2003/11/25 15:25:17 1.5 +++ rxvt-unicode/src/defaultfont.h 2004/01/31 00:20:21 1.10 @@ -1,9 +1,5 @@ -/* - * $Id: defaultfont.h,v 1.5 2003/11/25 15:25:17 pcg Exp $ - */ - -#ifndef _DEFAULTFONT_H_ -#define _DEFAULTFONT_H_ +#ifndef DEFAULTFONT_H_ +#define DEFAULTFONT_H_ #ifdef HAVE_XSETLOCALE # define X_LOCALE @@ -21,7 +17,16 @@ #include "rxvtlib.h" #include "feature.h" #include "encoding.h" -#include "rxvtvec.h" +#include "rxvtstl.h" + +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 @@ -30,10 +35,10 @@ 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; @@ -44,13 +49,15 @@ } rxvt_font () { name = 0; } - ~rxvt_font () { free (name); clear (); }; + ~rxvt_font () { clear (); free (name); }; void clear_rect (int x, int y, int w, int h, int color); 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, @@ -88,7 +95,7 @@ simplevec fonts; const rxvt_fallback_font *fallback; - int height; + rxvt_fontprop base_prop; int base_id; bool realize_font (int i);