/*

Compile with:
cc `pkg-config --cflags --libs pango gtk+-2.0` -o testcase2 testcase2.c

*/

#include <gtk/gtk.h>
#include <pango/pango.h>

int main( int   argc,
          char *argv[] )
{
    GtkWidget *window;
    PangoContext *context;
    PangoLayout *layout;
    PangoLayoutIter *iter;
    PangoRectangle extents;

    /* Original string */
    /* (the string retrieved from the assertion backtrace) */
    char *string_original = 
       "/home/future/\327\224\327\252\327\244\327\225\327\227\327\231\327\235 \327\221\327\222'\327\224-\327\244\327\220\327\237";

    /* Minimized testcase */
    /* <HEBREW ALEPH><HEBREW BETH><HEBREW GIMEL> */
    char *string = 
       "\327\220\327\221\327\222";
       
    printf("Testing with string: %s\n", string);
    
    gtk_init (&argc, &argv);
    
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_widget_show  (window);

    context = gtk_widget_get_pango_context (window);
    layout = pango_layout_new (context);
    pango_layout_set_text (layout, string, -1);

    iter = pango_layout_get_iter (layout);

    do {
      pango_layout_iter_get_char_extents (iter, &extents);
    } while (pango_layout_iter_next_char (iter));
    
    gtk_main ();
    
    return 0;
}


