comparison gtk/dw.c @ 1232:db21c0081387

Fixes for dw_font_text_extents_get() on GTK not honoring the font set by dw_pixmap_set_font().
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 16 Oct 2011 19:40:27 +0000
parents 1255ba41adad
children 3bc6244279c0
comparison
equal deleted inserted replaced
1231:4a7a9f102a5f 1232:db21c0081387
8054 { 8054 {
8055 int _locked_by_me = FALSE; 8055 int _locked_by_me = FALSE;
8056 GdkGC *gc = NULL; 8056 GdkGC *gc = NULL;
8057 #if GTK_MAJOR_VERSION > 1 8057 #if GTK_MAJOR_VERSION > 1
8058 PangoFontDescription *font; 8058 PangoFontDescription *font;
8059 char *tmpname, *fontname = "monospace 10";
8059 #else 8060 #else
8060 GdkFont *font; 8061 GdkFont *font;
8061 #endif
8062 char *tmpname, *fontname = "fixed"; 8062 char *tmpname, *fontname = "fixed";
8063 #endif
8063 #if GTK_CHECK_VERSION(2,10,0) 8064 #if GTK_CHECK_VERSION(2,10,0)
8064 cairo_t *cr = NULL; 8065 cairo_t *cr = NULL;
8065 #endif 8066 #endif
8066 8067
8067 if(!text) 8068 if(!text)
8240 fontname = dw_window_get_font(handle); 8241 fontname = dw_window_get_font(handle);
8241 free_fontname = 1; 8242 free_fontname = 1;
8242 } 8243 }
8243 } 8244 }
8244 else if(pixmap) 8245 else if(pixmap)
8245 fontname = (char *)gtk_object_get_data(GTK_OBJECT(pixmap->handle), "_dw_fontname"); 8246 {
8247 if(pixmap->font)
8248 fontname = pixmap->font;
8249 else if(pixmap->handle)
8250 fontname = (char *)gtk_object_get_data(GTK_OBJECT(pixmap->handle), "_dw_fontname");
8251 }
8246 8252
8247 #if GTK_MAJOR_VERSION > 1 8253 #if GTK_MAJOR_VERSION > 1
8248 font = pango_font_description_from_string(fontname ? fontname : "monospace 10"); 8254 font = pango_font_description_from_string(fontname ? fontname : "monospace 10");
8249 if(font) 8255 if(font)
8250 { 8256 {