Re: Font metrics question ?!




"Georg C. F. Greve" <greve@gnu.org> writes:

> Did anyone answer the font metrics question someone asked a week ago ?
> I didn't see the answer on the list but I think it is very interesting
> to hear what the clean way of getting the width of a certain string
> with a certain font would be. 

gint	 gdk_string_width   (GdkFont        *font,
			     const gchar    *string);

probably does what you want. (There are a large number
of such functions in GDK, most of them rather useless -
for instance gdk_text/string_measure seem to work out
to slow versions of the _width functions, except perhaps
for vertical text...)

> This could also be the solution to the
> size information I suggested that seemed to have passed through the
> list without anyone taking notice.

I did notice, though I didn't get around to responding. Yes,
being able to specify a width in characters for entry and
text widgets would be nice, though it is a little bit trickier than
gdk_text_width, since the typical fonts we use are proportionally
spaced.

Regards,
                                        Owen



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