repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: db3e89825cc395c5bb9fd7585051af754329c0b2:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit db3e89825cc395c5bb9fd7585051af754329c0b2
Author: Marc Lehmann 
Date:   Tue Jan 3 23:40:58 2006 +0000

    *** empty log message ***

diff --git a/Changes b/Changes
index 5f6b4272d61c0b16407aa03fbccbff8d03c4ebdb..
index ..c31aeba71445e7c9d7759adccce72cfaff6b4b39 100644
--- 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
index e3cbaeb180b4cd288a69f462c535ce02eef8da8c..
index ..2a204ba7dec3d567f86ac73b62fd221001516959 100644
--- 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
index 5fda418f6883ccb35b0a225528ef66c996f73330..
index ..3f315fa05744796fb11d9da852004a9c099a257c 100644
--- 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
index 8b8ef86d80209bae26a7ce3c7c72b0d4b4964757..
index ..b62cea18cdfc65632c3019de179baac2237bb563 100644
--- 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-----