--- rxvt-unicode/src/rxvtfont.h 2010/03/30 23:00:35 1.28 +++ rxvt-unicode/src/rxvtfont.h 2010/03/31 21:52:05 1.32 @@ -34,7 +34,7 @@ char *name; codeset cs; - bool loaded; // wether we tried loading it before (not wether it's loaded) + bool loaded; // whether we tried loading it before (not whether it's loaded) // managed by the font object int ascent, descent, @@ -69,23 +69,22 @@ char *fontdesc; enum { fontCount = 127 }; // must be power-of-two - 1, also has to match RS_fontMask in rxvt.h + enum { Careful = fontCount + 1 }; rxvt_fontset (rxvt_term *term); ~rxvt_fontset (); bool populate (const char *desc); void set_prop (const rxvt_fontprop &prop, bool force_prop) { this->prop = prop; this->force_prop = force_prop; } - int find_font_ (uint32_t unicode); // same as find_font, but does not limit index + int find_font_idx (uint32_t unicode); int find_font (uint32_t unicode); int find_font (const char *name) const; bool realize_font (int i); // font-id's MUST fit into a signed 16 bit integer, and within 0..255 - rxvt_font *get (uint32_t unicode, int id = fontCount) + rxvt_font *operator [] (int id) const { - id &= fontCount; - - return fonts[id == fontCount ? find_font_ (unicode) : id]; + return fonts[id & fontCount]; } private: