repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 1b546698e4a7209c48a4a1a93143599f26652752: path_to: revision_to:
commit 1b546698e4a7209c48a4a1a93143599f26652752 Author: Marc LehmannDate: Wed Mar 31 22:22:32 2010 +0000 *** empty log message *** diff --git a/src/main.C b/src/main.C
--- 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
--- 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
--- 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
--- 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:
-----END OF PAGE-----