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 96843 - pango_glyph_string_extents_range : not clear about the range spec.
pango_glyph_string_extents_range : not clear about the range spec.
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: docs
1.1.x
Other All
: Normal normal
: ---
Assigned To: Owen Taylor
Owen Taylor
Depends on:
Blocks:
 
 
Reported: 2002-10-25 23:22 UTC by Jungshik Shin
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jungshik Shin 2002-10-25 23:22:38 UTC
In the explanation for
pango_glyph_string_extents_range (..., start, end,....),
it's not made clear that 'start' index is inclusive while
'end' index is not inclusive. Just reading the explanation
gives an impression that both start and end are inclusive,
but the implementation in glyphstring.c clearly shows
that only 'start' is inclusive while 'end' is exclusive. 

I was bitten by this subtle problem while working on bug 96299.
It would be nice to make it clear that only 'start' is inclusive.
That is, the extent is calculated for a glyph string 
with  start <= index < end (not start <= index <= end). It may
be obvious to those who have worked with Pango or Gnome in general,
but I think it's a good idea to make it clear for those who haven't
worked on Pango before.
Comment 1 Owen Taylor 2002-11-26 01:51:03 UTC
It actually turns out to be the only sensible way of defining
it, since you want 'start - end == n_bytes'. But yeah, the
docs should have been more explicit.

Mon Nov 25 20:25:23 2002  Owen Taylor  <otaylor@redhat.com>

        * pango/glyphstring.c (pango_glyph_string_extents_range):
        Clarify the meaning of the @end parameter. (#96843,
        Jungshik Shin)