delete fontset[0];
fontset[0] = fs;
- prop = (*fs)[1]->properties ();
+ prop = (*fs)[rxvt_fontset::firstFont]->properties ();
prop.height += lineSpace;
prop.width += letterSpace;
#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
#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)
#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))
bool careful;
if (f->has_char (unicode, &prop, careful))
{
- if (careful)
- i |= 128;
+ i = (i << 1) | careful;
goto found;
}
int
rxvt_fontset::find_font (unicode_t unicode)
{
- int id = find_font_idx (unicode);
-
- return min<int> (fontCount, id & 127) | (id & 128 ? Careful : 0);
+ return min<int> ((fontCount << 1) | 1, find_font_idx (unicode));
}
+
{
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 ();
// 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: