Class GlyphItemIter

java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.pango.GlyphItemIter
All Implemented Interfaces:
Proxy

@Generated("io.github.jwharm.JavaGI") public class GlyphItemIter extends ProxyInstance
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 startIndex and startChar values. If glyphItem is right-to-left (that is, if glyph_item->item->analysis.level is odd), then startGlyph decreases as the iterator moves forward. Moreover, in right-to-left cases, startGlyph is greater than endGlyph.

An iterator should be initialized using either pango_glyph_item_iter_init_start() or pango_glyph_item_iter_init_end(), for forward and backward iteration respectively, and walked over using any desired mixture of pango_glyph_item_iter_next_cluster() and pango_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 glyphItem. The startIndex and endIndex values can directly index into text. The startGlyph, endGlyph, startChar, and endChar values however are zero-based for the glyphItem. 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.