Finding char boundaries in glyph list?



Hi all,

I've rendered some text (via PangoCairo), got the LogAttrs using pango_layout_get_log_attrs(), and then I'm walking through the glyphs in a run, like this:

for (i = 0; i < Run->glyphs->num_glyphs; i++)
                {
                glyphID = Run->glyphs->glyphs[i].glyph;
                ...
                }

How can I identify character boundaries as I walk through the glyphs in the run? (or to put it another way, map glyphs to chars). This doesn't have to be done directly *while* I walk through the run, it can be computed separately some other loop/walkthrough, just as long as I can somehow identify/relate which glyphs belong to which characters.

This is so I can take the LogAttr data (which is split by char) and 'merge' it with my list of glyphIDs for the purposes of knowing where text can wrap and the other info a LogAttr structure gives.

Many Thanks,
Alex



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]