# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1304835521 0 # Node ID 4ef0e878fe069da0fcb3cc8368f963b7cb4dec3a # Parent 99907f19a7037bb145997dd0825a105ac9a72e83 Added support for Dynamic Windows style font names for GTK3. diff -r 99907f19a703 -r 4ef0e878fe06 gtk3/dw.c --- a/gtk3/dw.c Sun May 08 03:28:10 2011 +0000 +++ b/gtk3/dw.c Sun May 08 06:18:41 2011 +0000 @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -2509,7 +2510,8 @@ { PangoFontDescription *pfont; GtkWidget *handle2 = handle; - char *font; + char *font = strdup(fontname); + char *name = strchr(font, '.'); int _locked_by_me = FALSE; gpointer data; @@ -2520,7 +2522,18 @@ if(tmp) handle2 = tmp; } - font = strdup(fontname); + + /* 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); + } /* Free old font name if one is allocated */ data = g_object_get_data(G_OBJECT(handle2), "_dw_fontname");