From: root Date: Wed, 31 Mar 2010 22:22:32 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=764e507eb4b0cc7f53bdd41630fd4984a3f94c64;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/src/main.C b/src/main.C index f9fd82e0..6d2a7a6c 100644 --- a/src/main.C +++ b/src/main.C @@ -690,7 +690,7 @@ rxvt_term::set_fonts () delete fontset[0]; fontset[0] = fs; - prop = (*fs)[1]->properties (); + prop = (*fs)[rxvt_fontset::firstFont]->properties (); prop.height += lineSpace; prop.width += letterSpace; diff --git a/src/rxvt.h b/src/rxvt.h index 85305650..205edf19 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -321,7 +321,7 @@ enum { #define RS_Uline 0x00040000UL // underline // toggle this to force redraw, must be != RS_Careful -#define RS_redraw 0x01000000UL +#define RS_redraw 0x02000000UL // 5 custom bits for extensions #define RS_customCount 32 @@ -329,7 +329,11 @@ enum { #define RS_customShift 19 // other flags -#define RS_Careful 0x80000000UL /* be careful when drawing these */ +#define RS_Careful 0x10000000UL /* be careful when drawing these */ + +#define RS_fontCount rxvt_fontset::fontCount +#define RS_fontMask 0xf0000000UL // plenty(?) of fonts, includes RS_Careful +#define RS_fontShift 28 #define RS_styleCount 4 #define RS_styleMask (RS_Bold | RS_Italic) @@ -338,10 +342,6 @@ enum { #define RS_baseattrMask (RS_Italic | RS_Bold | RS_Blink | RS_RVid | RS_Uline) #define RS_attrMask (RS_baseattrMask | RS_fontMask) -#define RS_fontCount rxvt_fontset::fontCount -#define RS_fontMask 0xff000000UL // plenty(?) of fonts, includes RS_Careful -#define RS_fontShift 24 - #define DEFAULT_RSTYLE (RS_None | Color_fg | (Color_bg << Color_Bits)) #define OVERLAY_RSTYLE (RS_None | Color_Black | (Color_Yellow << Color_Bits)) diff --git a/src/rxvtfont.C b/src/rxvtfont.C index 39b678e0..e746c2fc 100644 --- a/src/rxvtfont.C +++ b/src/rxvtfont.C @@ -1674,8 +1674,7 @@ rxvt_fontset::find_font_idx (unicode_t unicode) bool careful; if (f->has_char (unicode, &prop, careful)) { - if (careful) - i |= 128; + i = (i << 1) | careful; goto found; } @@ -1764,7 +1763,6 @@ found: int rxvt_fontset::find_font (unicode_t unicode) { - int id = find_font_idx (unicode); - - return min (fontCount, id & 127) | (id & 128 ? Careful : 0); + return min ((fontCount << 1) | 1, find_font_idx (unicode)); } + diff --git a/src/rxvtfont.h b/src/rxvtfont.h index 92711e6b..598e3f98 100644 --- a/src/rxvtfont.h +++ b/src/rxvtfont.h @@ -68,8 +68,8 @@ struct rxvt_fontset { char *fontdesc; - enum { fontCount = 127 }; // must be power-of-two - 1, also has to match RS_fontMask in rxvt.h - enum { Careful = fontCount + 1 }; + enum { fontCount = 7 }; // must be power-of-two - 1, also has to match RS_fontMask in rxvt.h + enum { firstFont = 2 }; // index of first font in set rxvt_fontset (rxvt_term *term); ~rxvt_fontset (); @@ -84,7 +84,7 @@ struct rxvt_fontset // font-id's MUST fit into a signed 16 bit integer, and within 0..255 rxvt_font *operator [] (int id) const { - return fonts[id & fontCount]; + return fonts[id >> 1]; } private: