GNOME Bugzilla – Bug 96843
pango_glyph_string_extents_range : not clear about the range spec.
Last modified: 2004-12-22 21:47:04 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.
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)