A <PangoGlyphItemIter> is an iterator over
the clusters in a <PangoGlyphItem>.
The forward direction of the iterator is the logical direction of
text. That is, with increasing start-index and start-char
values. If glyph-item is right-to-left (that is, if
glyph_item->item->analysis.level is odd), then start-glyph
decreases as the iterator moves forward. Moreover, in right-to-left
cases, start-glyph is greater than end-glyph.
An iterator should be initialized using either glyph-item-iter:init-start? or glyph-item-iter:init-end?, for forward and backward
iteration respectively, and walked over using any desired mixture of
glyph-item-iter:next-cluster?
and glyph-item-iter:prev-cluster?.
A common idiom for doing a forward iteration over the clusters is:
PangoGlyphItemIter cluster_iter;
gboolean have_cluster;
for (have_cluster = pango_glyph_item_iter_init_start (&cluster_iter,
glyph_item, text);
have_cluster;
have_cluster = pango_glyph_item_iter_next_cluster (&cluster_iter))
{
...
}
Note that text is the start of the text for layout, which is then
indexed by glyph_item->item->offset to get to the text of
glyph-item. The start-index and end-index values can
directly index into text. The start-glyph, end-glyph,
start-char, and end-char values however are zero-based for
the glyph-item. For each cluster, the item pointed at by the
start variables is included in the cluster while the one pointed at by
end variables is not.
None of the members of a
<PangoGlyphItemIter> should be modified
manually.
glyph-itemtextstart-glyphstart-indexstart-charend-glyphend-indexend-charMake a shallow copy of an existing
<PangoGlyphItemIter> structure.
Passed: a <PangoGlyphItemIter>.
a <PangoGlyphItem>Iter
Returned: a <PangoGlyphItemIter>, or
#f.
the newly allocated <PangoGlyphItemIter>
Frees a <PangoGlyphItem>Iter.
Passed: a <PangoGlyphItemIter>.
Initializes a <PangoGlyphItemIter> structure
to point to the last cluster in a glyph item.
See <PangoGlyphItemIter> for details of
cluster orders.
Passed: a <PangoGlyphItemIter>.
Passed: a <PangoGlyphItem>.
the glyph item to iterate over
Passed: a string.
text corresponding to the glyph item
Returned: a boolean.
#f if there are no clusters in the glyph item
Initializes a <PangoGlyphItemIter> structure
to point to the first cluster in a glyph item.
See <PangoGlyphItemIter> for details of
cluster orders.
Passed: a <PangoGlyphItemIter>.
Passed: a <PangoGlyphItem>.
the glyph item to iterate over
Passed: a string.
text corresponding to the glyph item
Returned: a boolean.
#f if there are no clusters in the glyph item
Advances the iterator to the next cluster in the glyph item.
See <PangoGlyphItemIter> for details of
cluster orders.
Passed: a <PangoGlyphItemIter>.
Returned: a boolean.
#t if the iterator was advanced, #f if we were already on
the last cluster.
Moves the iterator to the preceding cluster in the glyph item. See
<PangoGlyphItemIter> for details of cluster
orders.
Passed: a <PangoGlyphItemIter>.
Returned: a boolean.
#t if the iterator was moved, #f if we were already on the
first cluster.