Re: 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


I'd also like to know about this.

Should Alex be using a GlyphItemIter to iterate through a run (which is
really a glyphitem, right?)

Is there any way to mix a LayoutIter (which can step through chars) with
a GlyphItemIter (which can be used to step through glyphs in a run and
split or render them to screen)?

thanks -august




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