On 8/22/06, Francisco Moraes <francisco.moraes@xxxxxxxxx> wrote:
> Is this correct or is there a better way to figure out the text extents when
> using Pango?
try using the ink extents variant.
That's exactly what I have been using but my experience shows that it seems to be about twice as big in width than I expected:
gtk_print_context_create_pango_layout (pc);pango_layout_set_font_description (layout, current_font);
pango_layout_set_text (layout, text, -1);
pango_layout_context_changed (layout);pango_layout_get_extents (layout, &ink, &log);
g_object_unref (layout);
return (gdouble)ink.width / PANGO_SCALE;
This code above returns widths about twice as expected. Dividing by 2 produces better results that closely resemble what I expected.
Anyone knows anything about this or who to ask? This seems like a bug to me but I'd like to know if the code above is correct first before I open the bug report.
Francisco
_______________________________________________ gtk-list mailing list gtk-list@xxxxxxxxx http://mail.gnome.org/mailman/listinfo/gtk-list