GNOME Bugzilla – Bug 437533
Implement draw_shape PangoRenderer method
Last modified: 2009-03-27 16:55:06 UTC
like PangoCairoRenderer does now, such that shape rendering works using pango_cairo_context_set_shape_renderer().
Have a patch ?
In a minute. Need to clean up pango's first (no need to cache the set shape_renderer in PangoCairoRenderer. I'll remove the caching, then the draw_shape() method can be directly copied...)
Created attachment 87985 [details] [review] Untested patch I was wrong in the above comment. Each renderer has to cache shaperenderer itself cause in draw_shape() you don't have access to layout :(. I'm not very happy with how GdkPangoRenderer and PangoCairoRenderer interact. In particular, with the fact that features like this need to be duplicated. One way to improve this is to make PangoCairoRenderer public and make GdkPangoRenderer subclass it. Not sure how feasible that is. Anyway, the patch should work for now, but I've not tested it at all. Someone more comfortable with Gtk+ should port pango/examples/cairoshape.c to use gdkpango, and test the embossed attribute too.
Any news about testing this ?
Was hoping that someone steps up and test it. I'll port the test soonish.
Any update ?
I have some other plans about PangoCairoRenderer. Will make it public, then make GdkPangoCairo renderer subclass it directly. That drastically simplifies the gdkpango.c code.
Lemme reopen and go ahead with the first approach. I actually needed this today.
Created attachment 131475 [details] [review] Updated patch. Still not tested. Working on a test.
Created attachment 131504 [details] [review] gtk-demo patch Ok, I also changed rotated_text gtk-demo test to: 1) Port to pangocairo 2) Also show a rotated label 3) Install a custom shape renderer on both. The second one goes through gdkpango and hence tests the patch in this bug. It's working. Ideally I should move the shape renderer out into a demo of its own. But I already spent too much time on this.
draw_glyph_item doesn't make sense as gdkpango only renders to screen. Renaming.
2009-03-27 Behdad Esfahbod <behdad@gnome.org> Bug 437533 – Implement draw_shape PangoRenderer method * gdk/gdkpango.c (gdk_pango_renderer_draw_shape), (gdk_pango_renderer_class_init): Implement draw_shape * demos/gtk-demo/rotated_text.c (fancy_shape_renderer), (create_fancy_attr_list_for_layout), (rotated_text_expose_event), (do_rotated_text): 1) Port to pangocairo 2) Also show a rotated label 3) Install a custom shape renderer on both. The second one goes through gdkpango and hence tests the patch above. It's working.