Pango problems between gtk versions



Hi,
I have precompiled debian gtk binaries, and the test program works ok:

  libgtk2.0-0    2.4.2
  libglib2.0-0   2.4.2
  libpango1.0-0  1.4.0
  libatk1.0-0    1.6.1


I compiled the latest gtk with gcc-3.3, but the test program gives an
error:

  LATEST-ATK-1.6.0
  LATEST-GLIB-2.4.2
  LATEST-GTK+-2.4.3
  LATEST-PANGO-1.4.0

Error:

  ** (bugs:8899): WARNING **: Cannot open font file for font Verdana 10
  Segmentation fault


GDB shows it is trying to open:

  /usr/local/lib/msttcorefonts/verdana.ttf


ls -l /usr/local/lib/msttcorefonts/verdana.ttf

  -rw-rw-rw-    1 root     staff      139640 Dec 12  1998
                                      /usr/local/lib/msttcorefonts/verdana.ttf


#include <stdlib.h>
#include <stdio.h>
#include <gtk/gtk.h>
#include <gtk/gtksignal.h>
#include "xmalloc.h"

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

static gboolean delete( GtkWidget *widget,
                        GtkWidget *event,
                        gpointer   data )
{
    gtk_main_quit ();
    return FALSE;
}

int main(int argc, char *argv[])
{
    GtkWidget *window;

    gtk_init (&argc, &argv);

    window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
    g_signal_connect(G_OBJECT(window),"delete_event",G_CALLBACK(delete),NULL);
    gtk_widget_show_all(window);

    GdkScreen *screen = gdk_screen_get_default ();

    PangoContext *context=gdk_pango_context_get_for_screen(screen);
    pango_context_set_language(context,gtk_get_default_language());

    PangoFontDescription *desc=pango_context_get_font_description(context);
    pango_font_description_set_family(desc,"Sans");
    pango_font_description_set_weight(desc,PANGO_WEIGHT_NORMAL);
    pango_font_description_set_style(desc,PANGO_STYLE_NORMAL);
    pango_font_description_set_size(desc,10*PANGO_SCALE);

    PangoFont *font=pango_context_load_font(context,desc);
    PangoFontDescription *font_descr=pango_font_describe(font);

    PangoFontMetrics *metrics=pango_font_get_metrics(
                                    font,gtk_get_default_language());

    gtk_main ();

    return 0;
}

I got the above code out of gnumeric.

gnumeric and devhelp both give the same error message.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]