ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtfont.h
(Generate patch)

Comparing rxvt-unicode/src/rxvtfont.h (file contents):
Revision 1.25 by root, Wed Nov 5 14:43:54 2008 UTC vs.
Revision 1.29 by root, Tue Mar 30 23:36:14 2010 UTC

38 38
39 // managed by the font object 39 // managed by the font object
40 int ascent, descent, 40 int ascent, descent,
41 width, height; 41 width, height;
42 42
43 void set_name (char *name); 43 void set_name (char *name_);
44 44
45 rxvt_font (); 45 rxvt_font ();
46 virtual ~rxvt_font () { free (name); }; 46 virtual ~rxvt_font () { free (name); };
47 47
48 virtual void clear () { }; 48 virtual void clear () { };
66 66
67struct rxvt_fontset 67struct rxvt_fontset
68{ 68{
69 char *fontdesc; 69 char *fontdesc;
70 70
71 enum { fontCount = 3 }; // must be power-of-two - 1, also has to match RS_fontMask in rxvt.h
72 enum { Careful = fontCount + 1 };
73
71 rxvt_fontset (rxvt_term *term); 74 rxvt_fontset (rxvt_term *term);
72 ~rxvt_fontset (); 75 ~rxvt_fontset ();
73 76
74 bool populate (const char *desc); 77 bool populate (const char *desc);
75 void set_prop (const rxvt_fontprop &prop, bool force_prop) { this->prop = prop; this->force_prop = force_prop; } 78 void set_prop (const rxvt_fontprop &prop, bool force_prop) { this->prop = prop; this->force_prop = force_prop; }
76 int find_font (uint32_t unicode); 79 int find_font (uint32_t unicode);
77 int find_font (const char *name) const; 80 int find_font (const char *name) const;
78 bool realize_font (int i); 81 bool realize_font (int i);
79 82
80 // font-id's MUST fit into a signed 16 bit integer, and within 0..255 83 // font-id's MUST fit into a signed 16 bit integer, and within 0..255
81 rxvt_font *operator [] (int id) const 84 rxvt_font *get (uint32_t unicode, int id = fontCount)
82 { 85 {
83 return fonts[id & 0x7f]; 86 bool dummy;
87
88 id &= fontCount;
89
90 return fonts[id == fontCount ? find_font_idx (unicode, dummy) : id];
84 } 91 }
85 92
86private: 93private:
87 rxvt_term *term; 94 rxvt_term *term;
88 rxvt_fontprop prop; 95 rxvt_fontprop prop;
94 vector<pagemap *> fmap; 101 vector<pagemap *> fmap;
95 102
96 void clear (); 103 void clear ();
97 rxvt_font *new_font (const char *name, codeset cs); 104 rxvt_font *new_font (const char *name, codeset cs);
98 void add_fonts (const char *desc); 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
99}; 107};
100 108
101#endif /* _DEFAULTFONT_H_ */ 109#endif /* _DEFAULTFONT_H_ */
102 110

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines