The #GTK 3 porting guide suggests that you can make your life happier by drawing things with #Cairo instead of using GDK, since GTK 3 just uses Cairo, and there is no more GdkGC or GdkImage. Nearby it shows how to clip in Cairo to avoid overdraw.
There are #OCaml bindings to #Cairo; even though they are not part of lablgtk2, they work with lablgtk2. I don’t know how to do gdk_cairo_create() in lablgtk2 though.
Example #Cairo code showing different things you can do with text in Cairo in #GTK. Part of a GTK #tutorial.
on 02015-08-05#Cairo has two text rendering APIs of its own: the toy API, which takes UTF-8 and doesn’t do kerning, RTL, or even correct diacritics, and the low-level API, which lets you specify the glyph indexes and positions. cairo_show_glyphs and cairo_glyph_extents are probably the right thing. lablgtk2 doesn’t map any Cairo functions.
apparently #GTK 3 no longer exposes low-level text drawing routines; instead you have to use fucking #Pango and #Cairo.
on 02015-08-05