6 # include <X11/Xft/Xft.h>
14 #include "rxvttoolkit.h"
22 medium = 100, bold = 200,
23 roman = 0, italic = 100,
25 int width, height, ascent;
31 // managed by the fontset
33 void set_term (rxvt_term *term) { this->term = term; }
37 bool loaded; // wether we tried loading it before (not wether it's loaded)
39 // managed by the font object
43 void set_name (char *name_);
46 virtual ~rxvt_font () { free (name); };
48 virtual void clear () { };
50 void clear_rect (rxvt_drawable &d, int x, int y, int w, int h, int color) const;
52 virtual rxvt_fontprop properties () = 0;
54 virtual bool load (const rxvt_fontprop &morph, bool force_prop) = 0;
55 virtual bool has_char (uint32_t unicode, const rxvt_fontprop *prop, bool &careful) const = 0;
57 virtual void draw (rxvt_drawable &d,
59 const text_t *text, int len,
63 #define FONT_UNREF(f) do { (f)->clear (); delete (f); } while (0)
65 struct rxvt_fallback_font;
71 enum { fontCount = 3 }; // must be power-of-two - 1, also has to match RS_fontMask in rxvt.h
72 enum { Careful = fontCount + 1 };
74 rxvt_fontset (rxvt_term *term);
77 bool populate (const char *desc);
78 void set_prop (const rxvt_fontprop &prop, bool force_prop) { this->prop = prop; this->force_prop = force_prop; }
79 int find_font (uint32_t unicode);
80 int find_font (const char *name) const;
81 bool realize_font (int i);
83 // font-id's MUST fit into a signed 16 bit integer, and within 0..255
84 rxvt_font *get (uint32_t unicode, int id = fontCount)
90 return fonts[id == fontCount ? find_font_idx (unicode, dummy) : id];
97 simplevec<rxvt_font *> fonts;
98 const rxvt_fallback_font *fallback;
100 typedef unsigned char pagemap[256];
101 vector<pagemap *> fmap;
104 rxvt_font *new_font (const char *name, codeset cs);
105 void add_fonts (const char *desc);
106 int find_font_idx (uint32_t unicode, bool &careful); // same as find_font, but does not limit index
109 #endif /* _DEFAULTFONT_H_ */