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? thanks -august. ___ gtk-i18n-list mailing list gtk-i18n-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-i18n-list
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. ___ gtk-i18n-list mailing list gtk-i18n-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-i18n-list
iterate through a layout by char or word?
Is there any way to iterate through a PangoyLayout by character or word? Is there a way to iterate by word and then show it using cairo? I can do something similar with pango_itemize, pango_break, and pango_shape. But, I can't seem to do anything with the resulting PangoGlyphString that I get. I can do pango_cairo_show_glyph_string(), but I want to just show a word or character. Is there something like pango_cairo_show_glyph_string_range()? I can do pango_glyph_string_copy(), but cant do anything like strncpy where I can just get a segment of that PangoGlyphString. Any tips would be greatly appreciated. thanks -august. ___ gtk-i18n-list mailing list gtk-i18n-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-i18n-list