Ethereal-dev: Re: [ethereal-dev] working patch for cleanly scrolling the byte view
On Sun, Nov 21, 1999 at 08:33:01PM -0600, Nathan Neulinger wrote:
>
> It currently has one hardwired value that should probably be turned into
> some function call, I just don't know what it is. I use "+ 4" to the
> height of each row of text to get the row spacing in the text box. It
> works for the default font, but may not be exactly right for others. But
> other than that, it gets rid of any flicker. Even if it doesn't scroll
> quite right for different fonts, it's still going to put the scrollbar
> in a better position than at the top.
You're using this:
+ /* need to change to some way of getting that offset instead of +4 */
+ lineheight = gdk_string_height(m_b_font, "0") + 4;
The doco for gdk_string_height() at
http://developer.gnome.org/doc/API/gdk/gdk-fonts.html
says:
Determines the total height of a given NULL-terminated string. This
value is not generally useful, because you cannot determine how
this total height will be drawn in relation to the baseline. See
gdk_string_extents().
gdk_string_extents retrieves:
left bearing
right bearing
width
ascent
descent
ascent and descent are defined as:
ascent
the maximum distance that the font, when drawn, ascends above the baseline.
descent
the maximum distance that the font, when drawn, descends below the baseline.
Maybe those two measurements will help? There's probably still row
spacing in there, though.
--gilbert