projects
/
dana
/
urxvt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
764e507
)
*** empty log message ***
author
root
<root>
Wed, 31 Mar 2010 22:46:40 +0000
(22:46 +0000)
committer
root
<root>
Wed, 31 Mar 2010 22:46:40 +0000
(22:46 +0000)
src/rxvt.h
patch
|
blob
|
history
src/rxvtfont.C
patch
|
blob
|
history
src/rxvtfont.h
patch
|
blob
|
history
diff --git
a/src/rxvt.h
b/src/rxvt.h
index
205edf1
..
3e1d4cc
100644
(file)
--- a/
src/rxvt.h
+++ b/
src/rxvt.h
@@
-320,7
+320,7
@@
enum {
#define RS_RVid 0x00020000UL // reverse video
#define RS_Uline 0x00040000UL // underline
#define RS_RVid 0x00020000UL // reverse video
#define RS_Uline 0x00040000UL // underline
-// toggle this to force redraw, must be != RS_Careful
+// toggle this to force redraw, must be != RS_Careful
and otherwise "pretty neutral"
#define RS_redraw 0x02000000UL
// 5 custom bits for extensions
#define RS_redraw 0x02000000UL
// 5 custom bits for extensions
diff --git
a/src/rxvtfont.C
b/src/rxvtfont.C
index
e746c2f
..
efc9069
100644
(file)
--- a/
src/rxvtfont.C
+++ b/
src/rxvtfont.C
@@
-484,10
+484,10
@@
rxvt_font_default::draw (rxvt_drawable &d, int x, int y,
}
}
}
}
-struct rxvt_font_
meta
: rxvt_font {
+struct rxvt_font_
overflow
: rxvt_font {
struct rxvt_fontset *fs;
struct rxvt_fontset *fs;
- rxvt_font_
meta
(rxvt_fontset *fs)
+ rxvt_font_
overflow
(rxvt_fontset *fs)
: rxvt_font ()
{
this->fs = fs;
: rxvt_font ()
{
this->fs = fs;
@@
-510,7
+510,7
@@
struct rxvt_font_meta : rxvt_font {
width = 1; height = 1;
ascent = 1; descent = 0;
width = 1; height = 1;
ascent = 1; descent = 0;
- set_name (strdup ("built-in
meta
font"));
+ set_name (strdup ("built-in
rendition overflow
font"));
return true;
}
return true;
}
@@
-1496,6
+1496,15
@@
rxvt_fontset::clear ()
fallback = fallback_fonts;
}
fallback = fallback_fonts;
}
+void
+rxvt_fontset::prepare_font (rxvt_font *font, codeset cs)
+{
+ font->set_term (term);
+
+ font->cs = cs;
+ font->loaded = false;
+}
+
rxvt_font *
rxvt_fontset::new_font (const char *name, codeset cs)
{
rxvt_font *
rxvt_fontset::new_font (const char *name, codeset cs)
{
@@
-1521,11
+1530,8
@@
rxvt_fontset::new_font (const char *name, codeset cs)
else
f = new rxvt_font_x11;
else
f = new rxvt_font_x11;
- f->set_term (term);
f->set_name (strdup (name));
f->set_name (strdup (name));
-
- f->cs = cs;
- f->loaded = false;
+ prepare_font (f, cs);
return f;
}
return f;
}
@@
-1533,6
+1539,20
@@
rxvt_fontset::new_font (const char *name, codeset cs)
/////////////////////////////////////////////////////////////////////////////
void
/////////////////////////////////////////////////////////////////////////////
void
+rxvt_fontset::push_font (rxvt_font *font)
+{
+ if (fonts.size () == fontCount)
+ {
+ rxvt_font *f = new rxvt_font_overflow (this);
+
+ prepare_font (f, CS_UNICODE);
+ fonts.push_back (f);
+ }
+
+ fonts.push_back (font);
+}
+
+void
rxvt_fontset::add_fonts (const char *desc)
{
if (desc)
rxvt_fontset::add_fonts (const char *desc)
{
if (desc)
@@
-1581,7
+1601,7
@@
rxvt_fontset::add_fonts (const char *desc)
memcpy (buf, desc, end - desc);
buf[end - desc] = 0;
memcpy (buf, desc, end - desc);
buf[end - desc] = 0;
-
fonts.push_back
(new_font (buf, cs));
+
push_font
(new_font (buf, cs));
}
else
rxvt_warn ("fontset element too long (>511 bytes), ignored.");
}
else
rxvt_warn ("fontset element too long (>511 bytes), ignored.");
@@
-1619,7
+1639,7
@@
rxvt_fontset::populate (const char *desc)
fontdesc = strdup (desc);
fontdesc = strdup (desc);
-
fonts.push_back
(new_font (0, CS_UNICODE));
+
push_font
(new_font (0, CS_UNICODE));
realize_font (0);
add_fonts (desc);
realize_font (0);
add_fonts (desc);
@@
-1685,7
+1705,7
@@
rxvt_fontset::find_font_idx (unicode_t unicode)
if (fallback->name)
{
// search through the fallback list
if (fallback->name)
{
// search through the fallback list
-
fonts.push_back
(new_font (fallback->name, fallback->cs));
+
push_font
(new_font (fallback->name, fallback->cs));
fallback++;
}
else
fallback++;
}
else
@@
-1728,7
+1748,7
@@
rxvt_fontset::find_font_idx (unicode_t unicode)
char fontname[4096];
snprintf (fontname, sizeof (fontname), "xft:%s", font);
char fontname[4096];
snprintf (fontname, sizeof (fontname), "xft:%s", font);
-
fonts.push_back
(new_font (fontname, CS_UNICODE));
+
push_font
(new_font (fontname, CS_UNICODE));
}
free (font);
}
free (font);
@@
-1760,9
+1780,3
@@
found:
return i;
}
return i;
}
-int
-rxvt_fontset::find_font (unicode_t unicode)
-{
- return min<int> ((fontCount << 1) | 1, find_font_idx (unicode));
-}
-
diff --git
a/src/rxvtfont.h
b/src/rxvtfont.h
index
598e3f9
..
8631ea2
100644
(file)
--- a/
src/rxvtfont.h
+++ b/
src/rxvtfont.h
@@
-68,7
+68,7
@@
struct rxvt_fontset
{
char *fontdesc;
{
char *fontdesc;
- enum { fontCount =
7
}; // must be power-of-two - 1, also has to match RS_fontMask in rxvt.h
+ enum { fontCount =
3
}; // 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);
enum { firstFont = 2 }; // index of first font in set
rxvt_fontset (rxvt_term *term);
@@
-77,16
+77,20
@@
struct rxvt_fontset
bool populate (const char *desc);
void set_prop (const rxvt_fontprop &prop, bool force_prop) { this->prop = prop; this->force_prop = force_prop; }
int find_font_idx (uint32_t unicode);
bool populate (const char *desc);
void set_prop (const rxvt_fontprop &prop, bool force_prop) { this->prop = prop; this->force_prop = force_prop; }
int find_font_idx (uint32_t unicode);
- int find_font (uint32_t unicode);
int find_font (const char *name) const;
bool realize_font (int i);
int find_font (const char *name) const;
bool realize_font (int i);
- // font-id's MUST fit into a signed 16 bit integer, and within 0..255
rxvt_font *operator [] (int id) const
{
return fonts[id >> 1];
}
rxvt_font *operator [] (int id) const
{
return fonts[id >> 1];
}
+ int
+ find_font (unicode_t unicode)
+ {
+ return min<int> ((fontCount << 1) | 1, find_font_idx (unicode));
+ }
+
private:
rxvt_term *term;
rxvt_fontprop prop;
private:
rxvt_term *term;
rxvt_fontprop prop;
@@
-99,7
+103,9
@@
private:
void clear ();
rxvt_font *new_font (const char *name, codeset cs);
void clear ();
rxvt_font *new_font (const char *name, codeset cs);
+ void prepare_font (rxvt_font *font, codeset cs);
void add_fonts (const char *desc);
void add_fonts (const char *desc);
+ void push_font (rxvt_font *font);
};
#endif /* _DEFAULTFONT_H_ */
};
#endif /* _DEFAULTFONT_H_ */