repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: db3e89825cc395c5bb9fd7585051af754329c0b2: path_to: revision_to:
commit db3e89825cc395c5bb9fd7585051af754329c0b2 Author: Marc LehmannDate: Tue Jan 3 23:40:58 2006 +0000 *** empty log message *** diff --git a/Changes b/Changes
--- a/Changes
+++ b/Changes
@@ -23,6 +23,7 @@ WISH: better support for mixing xft font sizes rxvt -fn "xft:Andale Mono:size=15
intelligent/customized selection support, visual feedback,
menus, tabs etc. See the the urxvtperl manpage, the -pe option,
perl*-resources and keysym resources. Not everything is there yet.
+ - try to be more clever about differing font sizes and their ascent.
- fix directory permissions on install.
- improved sched_yield support.
diff --git a/src/main.C b/src/main.C
--- a/src/main.C
+++ b/src/main.C
@@ -925,7 +925,7 @@ rxvt_term::set_fonts ()
fwidth = prop.width;
fheight = prop.height;
- fbase = (*fs)[1]->ascent;
+ fbase = prop.ascent;
for (int style = 1; style < 4; style++)
{
diff --git a/src/rxvtfont.C b/src/rxvtfont.C
--- a/src/rxvtfont.C
+++ b/src/rxvtfont.C
@@ -278,6 +278,7 @@ struct rxvt_font_default : rxvt_font {
rxvt_fontprop p;
p.width = p.height = 1;
+ p.ascent = rxvt_fontprop::unset;
p.weight = rxvt_fontprop::medium;
p.slant = rxvt_fontprop::roman;
@@ -525,6 +526,7 @@ rxvt_font_x11::set_properties (rxvt_fontprop &p, int height, const char *weight,
{
p.width = avgwidth ? (avgwidth + 1) / 10 : (height + 1) / 2;
p.height = height;
+ p.ascent = rxvt_fontprop::unset;
p.weight = *weight == 'B' || *weight == 'b' ? rxvt_fontprop::bold : rxvt_fontprop::medium;
p.slant = *slant == 'r' || *slant == 'R' ? rxvt_fontprop::roman : rxvt_fontprop::italic;
@@ -555,6 +557,8 @@ rxvt_font_x11::set_properties (rxvt_fontprop &p, XFontStruct *f)
free (weight);
free (slant);
+ p.ascent = f->ascent;
+
return true;
}
@@ -1075,6 +1079,7 @@ rxvt_font_xft::properties ()
p.width = width;
p.height = height;
+ p.ascent = ascent;
p.weight = face->style_flags & FT_STYLE_FLAG_BOLD
? rxvt_fontprop::bold : rxvt_fontprop::medium;
p.slant = face->style_flags & FT_STYLE_FLAG_ITALIC
@@ -1338,7 +1343,7 @@ rxvt_fontset::~rxvt_fontset ()
void
rxvt_fontset::clear ()
{
- prop.width = prop.height = prop.weight = prop.slant
+ prop.width = prop.height = prop.ascent = prop.weight = prop.slant
= rxvt_fontprop::unset;
for (rxvt_font **i = fonts.begin (); i != fonts.end (); i++)
@@ -1521,6 +1526,9 @@ rxvt_fontset::find_font (unicode_t unicode)
if (!realize_font (i))
goto next_font;
+
+ if (prop.ascent != rxvt_fontprop::unset)
+ max_it (f->ascent, prop.ascent);
}
if (f->cs == CS_UNKNOWN)
diff --git a/src/rxvtfont.h b/src/rxvtfont.h
--- a/src/rxvtfont.h
+++ b/src/rxvtfont.h
@@ -34,7 +34,7 @@ struct rxvt_fontprop {
medium = 100, bold = 200,
roman = 0, italic = 100,
};
- int width, height;
+ int width, height, ascent;
int weight, slant;
};
-----END OF PAGE-----