After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 328456 - Add pango_layout_get_effective_width
Add pango_layout_get_effective_width
Status: RESOLVED DUPLICATE of bug 326693
Product: pango
Classification: Platform
Component: general
unspecified
Other All
: Normal enhancement
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2006-01-24 17:44 UTC by Behdad Esfahbod
Modified: 2006-01-29 01:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Behdad Esfahbod 2006-01-24 17:44:02 UTC
A function to get the effective width of the layout as it will be rendered, is useful.

It should be something like:

int
pango_layout_get_effective_width (const PangoLayout *layout)
{
  int width;

  width = pango_layout_get_width (layout);
  if (width == -1)
    pango_layout_get_size (layout, &width, NULL);
}


This is extremely useful when positioning right-to-left layouts, in Gtk+ for example.  The problem is that when doing rtl, the caller needs to know how much to offset the layout, and neither get_width, nor get_size work correctly.
Comment 1 Behdad Esfahbod 2006-01-24 18:37:54 UTC
Oops.  It should return the width, of course.
Comment 2 Behdad Esfahbod 2006-01-29 01:41:36 UTC

*** This bug has been marked as a duplicate of 326693 ***