Re: glyphs



> Hi,
> 	I'm a newbie to pango low-level functions and am trying to learn how
> 	to use pango_itemize, pango_break, and pango_shape properly. 
> 
> 	Given an item from pango_itemize, I do:
> 
> 
> 	PangoGlyphString *glyphs = pango_glyph_string_new();
> 	pango_glyph_string_set_size(glyphs, item->num_chars);
> 	pango_shape(text+item->offset, item->length, &item->analysis, glyphs);
> 
> 	printf("number of glyphs: %d \n", glyphs->num_glyphs);
> 
> 	for (int j=1;j< glyphs->num_glyphs ;j++){
> 		// crashes here
> 		printf("#%d, guint32 glyph=%d\n", j, glyphs[j].glyphs->glyph );
> 	}
> 
> 
> 	What am I doing wrong? 
> 

it figures that I have been staring at this for a few hours already and
notice my mistake right after I send for help to the list.

It should be:
printf("#%d, guint32 glyph=%d\n", j, glyphs->glyphs[j].glyph );


sorry for the noise.

But, if anyone has a link to some readable example code using
pango_itemize, pango_break, and pango_shape, I'd really appreciate it.
I cannot find anything online.


-august.


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