Ethereal-dev: Re: [Ethereal-dev] [PATCH] Fix for text width with gtk2

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Olivier Abad <oabad@xxxxxxx>
Date: Mon, 17 Feb 2003 08:56:17 +0100
On Thu, Feb 13, 2003 at 03:05:48PM -0500, Pavel Roskin wrote:
> --- gtk/main.c
> +++ gtk/main.c
> @@ -1039,7 +1039,7 @@ set_plist_font(PangoFontDescription *fon
>  			get_column_longest_string(get_column_format(i)));
>  #else
>  		cfile.cinfo.col_width[i] =
> -                    gdk_string_width(gdk_font_from_description(font),
> +                    gdk_string_width(gtk_style_get_font(packet_list->style),
>  			get_column_longest_string(get_column_format(i)));
>  #endif
>  	}
> ==================================
> 
> I'm using Red Hat Linux 8.0 with gtk-2.0.6.  I have no idea why
> gdk_font_from_description() doesn't work for me.

The deprecated function gdk_font_from_description() tries to load a
GdkFont which is an approximation of a Pango font. It can fail (and
return NULL).

I replaced it with its pango equivalent in CVS. Can you try it (it works
for me with gtk+ 2.2.1 / pango 1.2.1) ?

Olivier
-- 
It's sweet to be remembered, but it's often cheaper to be forgotten.