*** empty log message ***
authorroot <root>
Wed, 31 Mar 2010 22:22:32 +0000 (22:22 +0000)
committerroot <root>
Wed, 31 Mar 2010 22:22:32 +0000 (22:22 +0000)
src/main.C
src/rxvt.h
src/rxvtfont.C
src/rxvtfont.h

index f9fd82e..6d2a7a6 100644 (file)
@@ -690,7 +690,7 @@ rxvt_term::set_fonts ()
   delete fontset[0];
   fontset[0] = fs;
 
   delete fontset[0];
   fontset[0] = fs;
 
-  prop = (*fs)[1]->properties ();
+  prop = (*fs)[rxvt_fontset::firstFont]->properties ();
   prop.height += lineSpace;
   prop.width += letterSpace;
 
   prop.height += lineSpace;
   prop.width += letterSpace;
 
index 8530565..205edf1 100644 (file)
@@ -321,7 +321,7 @@ enum {
 #define RS_Uline                0x00040000UL    // underline
 
 // toggle this to force redraw, must be != RS_Careful
 #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
 
 // 5 custom bits for extensions
 #define RS_customCount          32
@@ -329,7 +329,11 @@ enum {
 #define RS_customShift          19
 
 // other flags
 #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_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_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))
 
 #define DEFAULT_RSTYLE  (RS_None | Color_fg | (Color_bg << Color_Bits))
 #define OVERLAY_RSTYLE  (RS_None | Color_Black | (Color_Yellow << Color_Bits))
 
index 39b678e..e746c2f 100644 (file)
@@ -1674,8 +1674,7 @@ rxvt_fontset::find_font_idx (unicode_t unicode)
       bool careful;
       if (f->has_char (unicode, &prop, careful))
         {
       bool careful;
       if (f->has_char (unicode, &prop, careful))
         {
-          if (careful)
-            i |= 128;
+          i = (i << 1) | careful;
 
           goto found;
         }
 
           goto found;
         }
@@ -1764,7 +1763,6 @@ found:
 int
 rxvt_fontset::find_font (unicode_t unicode)
 {
 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));
 }
 }
+
index 92711e6..598e3f9 100644 (file)
@@ -68,8 +68,8 @@ struct rxvt_fontset
 {
   char *fontdesc;
 
 {
   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 ();
 
   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
   {
   // 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:
   }
 
 private: