Re: GdkFont->Pango replacement



Deepa Chacko Pillai <deepa chacko wipro com> writes:

> Hi
> 
> I am facing few problems when I replace gdk_draw_string with pango
> equivalents. I am using PangoLayout.
> 
> *    Earlier gdk_font_width () used to give the distance from the
> beginning of the current string to the point where the next string is to
> be drawn. The closest equivalent I found to this is
> pango_font_metrics_get_approximate_char_width (metrics).  It gives the
> character width. Can I multiply this by the length of the string to get
> string width as given by gdk_font_width ()? Or is there any other way
> for doing this?

Generally, drawing a string in multiple pieces is a bad idea with
Pango, since the pieces may interact.

You'd be better off creating a single PangoLayout and drawing that.

Regards,
                                        Owen



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