[cairo] Cairo / Pango Integration Issue
robertk54 at aol.com
robertk54 at aol.com
Mon Mar 24 10:34:13 PDT 2008
Having some trouble rendering now that I have added Pango to my existing Cairo implementation.
<<
#0? *INT_cairo_restore (cr=0x0) at cairo.c:397
#1? 0x00304f45 in pango_cairo_renderer_draw_glyphs (renderer=0xbb318a0, font=0xbb2d018, glyphs=0xbb33b90, x=0, y=37888)
??? at pangocairo-render.c:360
#2? 0x008f3e00 in pango_renderer_draw_glyphs (renderer=0xbb318a0, font=0xbb2d018, glyphs=0xbb33b90, x=0, y=37888)
??? at pango-renderer.c:629
#3? 0x008f4f70 in pango_renderer_draw_layout_line (renderer=0xbb318a0, line=0xbb30cc8, x=0, y=37888)
??? at pango-renderer.c:559
#4? 0x008f51f1 in pango_renderer_draw_layout (renderer=0xbb318a0, layout=0xbb18770, x=0, y=0) at pango-renderer.c:186
#5? 0x003057d9 in _pango_cairo_do_layout (cr=0x88dca748, layout=0xbb18770, do_path=0) at pangocairo-render.c:670
>>
The code correlating to the above is as follows . . .
<<
cairo_save (cr);
pango_layout_set_text (layout, utf8, -1);
cairo_set_source_rgba (cr, r, g, b, a);
pango_cairo_update_layout (cr, layout);
pango_layout_get_size (layout, &width, &height);
cairo_move_to (cr, m_dXPos+m_dXPosStart, m_dYPos+m_dYPosStart);
pango_cairo_show_layout(cr, layout);
cairo_restore (cr);
>>
I know the cairo context is fine up to the call to pango_cairo_show_layout.? Not sure how it becomes NULL at the point I get the segfault.? I am using a cairo surface based on?an external?ARGB data buffer as shown below, this worked fine when using just cairo.? Anyone have any suggestions?
<<
surface = cairo_image_surface_create_for_data (pRGB32Buffer, CAIRO_FORMAT_ARGB32, width, height, width*4);
cr = cairo_create(surface);
fontmap = pango_cairo_font_map_get_default ();
layout = pango_cairo_create_layout (cr);
>>
Thanks,
Bob
cr = cairo_create(surface);
fontmap = pango_cairo_font_map_get_default ();
layout = pango_cairo_create_layout (cr);
>>
Thanks,
Bob
>>
Thanks,
Bob
cr = cairo_create(surface);
fontmap = pango_cairo_font_map_get_default ();
layout = pango_cairo_create_layout (cr);
>>
Thanks,
Bob
layout = pango_cairo_create_layout (cr);
>>
Thanks,
Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20080324/e66043d9/attachment.htm
More information about the cairo
mailing list