Re: Question/Suggestion for gdk




Brandon Long <blong@fiction.net> writes:

> I note that gdk 1.1.1 adds a way to get the height of a string using
> XTextExtents().  Is there a way to get this information using 1.0.5?

#include <gdk/gdkx.h>

XTextExtents (GDK_FONT_XFONT (some_font), ....);
 
is about as good as it gets.

> Also, if one wants both the height and width, one needs to call both
> functions, which means gdk makes two calls to XTextExtents().  Should
> there be a function which does just one?

The current CVS GDK includes:

void     gdk_string_extents (GdkFont     *font,
			     const gchar *string,
			     gint        *lbearing,
			     gint        *rbearing,
			     gint        *width,
			     gint        *ascent,
			     gint        *descent);
Regards,
                                       Owen





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]