--- rxvt-unicode/src/rxvtfont.h 2010/05/23 00:12:02 1.39 +++ rxvt-unicode/src/rxvtfont.h 2021/06/17 19:37:28 1.46 @@ -8,7 +8,6 @@ #include -#include "feature.h" #include "encoding.h" #include "rxvtutil.h" #include "rxvttoolkit.h" @@ -74,9 +73,9 @@ // must be power-of-two - 1, also has to match RS_fontMask in rxvt.h #if USE_256_COLORS - enum { fontCount = 7 }; // 4 extra colors bits, 4 fewer fontcount bits + enum { fontCount = 7 }; // 2 extra colors bits, 2 fewer fontcount bits #else - enum { fontCount = 127 }; + enum { fontCount = 31 }; #endif // index of first font in set @@ -102,6 +101,15 @@ return min ((fontCount << 1) | 1, find_font_idx (unicode)); } + // find the font containing ' ' - we always assume this is font 1, as + // every font should contain space, and font 1 is our base font. + // pango assumes this, so it must be correct! + int + find_space_font () + { + return 1 << 1; + } + private: rxvt_term *term; rxvt_fontprop prop; @@ -109,7 +117,18 @@ simplevec fonts; const rxvt_fallback_font *fallback; - typedef unsigned char pagemap[256]; + // this once was a "typedef xxx pagemap[256] + // but c++ arrays are not normal types, and cannot be + // put into containers, new doesn't work for them etc. etc. + // so we wrap out array into an object that acts like one. doh. + // example: C++ has no separate new and new [] forms, + // and if pagemap is char[256], new incorrectly assumes we want to + // allocate an array of chars instead of a single pagemap. + struct pagemap + { + unsigned char cppsucks[256]; + unsigned char &operator [](int i) { return cppsucks [i]; }; + }; vector fmap; void clear ();