After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 437533 - Implement draw_shape PangoRenderer method
Implement draw_shape PangoRenderer method
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on: 472626
Blocks:
 
 
Reported: 2007-05-10 19:24 UTC by Behdad Esfahbod
Modified: 2009-03-27 16:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Untested patch (4.80 KB, patch)
2007-05-10 23:37 UTC, Behdad Esfahbod
none Details | Review
Updated patch. (2.00 KB, patch)
2009-03-27 01:51 UTC, Behdad Esfahbod
committed Details | Review
gtk-demo patch (10.04 KB, patch)
2009-03-27 16:48 UTC, Behdad Esfahbod
committed Details | Review

Description Behdad Esfahbod 2007-05-10 19:24:26 UTC
like PangoCairoRenderer does now, such that shape rendering works using pango_cairo_context_set_shape_renderer().
Comment 1 Matthias Clasen 2007-05-10 19:35:17 UTC
Have a patch ?
Comment 2 Behdad Esfahbod 2007-05-10 20:13:02 UTC
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...)
Comment 3 Behdad Esfahbod 2007-05-10 23:37:53 UTC
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.
Comment 4 Matthias Clasen 2007-11-21 05:26:17 UTC
Any news about testing this ?
Comment 5 Behdad Esfahbod 2007-11-21 08:49:29 UTC
Was hoping that someone steps up and test it.  I'll port the test soonish.
Comment 6 Matthias Clasen 2008-05-24 19:21:36 UTC
Any update ?
Comment 7 Behdad Esfahbod 2008-05-25 01:37:57 UTC
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.
Comment 8 Behdad Esfahbod 2009-03-27 00:11:49 UTC
Lemme reopen and go ahead with the first approach.  I actually needed this today.
Comment 9 Behdad Esfahbod 2009-03-27 01:51:46 UTC
Created attachment 131475 [details] [review]
Updated patch.

Still not tested.  Working on a test.
Comment 10 Behdad Esfahbod 2009-03-27 16:48:27 UTC
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.
Comment 11 Behdad Esfahbod 2009-03-27 16:53:57 UTC
draw_glyph_item doesn't make sense as gdkpango only renders to screen.  Renaming.
Comment 12 Behdad Esfahbod 2009-03-27 16:55:06 UTC
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.