# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1304836221 0 # Node ID 08b7e8d7cbb3dcee645f2c578fc5167fd131bd42 # Parent 0802d6122ec72f1def8d1cdb69efca19b4691bab Added support for Dynamic Windows style font names for GTK2. diff -r 0802d6122ec7 -r 08b7e8d7cbb3 gtk/dw.c --- a/gtk/dw.c Sun May 08 06:24:52 2011 +0000 +++ b/gtk/dw.c Sun May 08 06:30:21 2011 +0000 @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -2736,7 +2737,8 @@ GdkFont *gdkfont; #endif GtkWidget *handle2 = handle; - char *font; + char *font = strdup(fontname); + char *name = strchr(font, '.'); int _locked_by_me = FALSE; gpointer data; @@ -2747,7 +2749,6 @@ if(tmp) handle2 = tmp; } - font = strdup(fontname); #if GTK_MAJOR_VERSION < 2 /* Free old font if it exists */ @@ -2758,6 +2759,19 @@ if(!gdkfont) gdkfont = gdk_font_load("fixed"); gtk_object_set_data(GTK_OBJECT(handle2), "_dw_gdkfont", (gpointer)gdkfont); +#else + + /* Detect Dynamic Windows style font name... + * Format: ##.Fontname + * and convert to a Pango name + */ + if(name && isdigit(*font)) + { + int size = atoi(font); + *name = 0; + name++; + sprintf(font, "%s %d", name, size); + } #endif /* Free old font name if one is allocated */