#include #include #include int main( int argc, char **argv ) { GtkWidget *window, *label; PangoLayout *layout; char text[ 15 ]; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); label = gtk_label_new ("hi there"); gtk_container_add (GTK_CONTAINER (window), label); gtk_widget_show_all (window); g_signal_connect (G_OBJECT (window), "delete_event", G_CALLBACK (gtk_main_quit), 0); layout = pango_layout_new (gtk_widget_get_pango_context (label)); text[ 0 ] = -30; text[ 1 ] = -128; text[ 2 ] = -117; text[ 3 ] = -17; text[ 4 ] = -69; text[ 5 ] = -65; text[ 6 ] = 47; text[ 7 ] = 42; text[ 8 ] = 0; pango_layout_set_text (layout, text, -1); fprintf( stderr, "Layout width is %d\n", pango_layout_get_width (layout)); fprintf( stderr, "Text is: \"%s\"\n", text); fprintf( stderr, "Line count is %d\n", pango_layout_get_line_count (layout)); gtk_main(); return 0; }