Re: GtkPrint PangoLayout extents
- From: "Francisco Moraes" <francisco moraes gmail com>
- To: paul linuxaudiosystems com, gtk-list gnome org
- Subject: Re: GtkPrint PangoLayout extents
- Date: Fri, 1 Sep 2006 20:23:00 -0400
On 8/22/06, Francisco Moraes <francisco moraes gmail com> 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]