Mercurial > dwindows
comparison gtk3/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 |
---|---|
6922 void dw_draw_text(HWND handle, HPIXMAP pixmap, int x, int y, char *text) | 6922 void dw_draw_text(HWND handle, HPIXMAP pixmap, int x, int y, char *text) |
6923 { | 6923 { |
6924 int _locked_by_me = FALSE; | 6924 int _locked_by_me = FALSE; |
6925 cairo_t *cr = NULL; | 6925 cairo_t *cr = NULL; |
6926 PangoFontDescription *font; | 6926 PangoFontDescription *font; |
6927 char *tmpname, *fontname = "fixed"; | 6927 char *tmpname, *fontname = "monospace 10"; |
6928 | 6928 |
6929 if(!text) | 6929 if(!text) |
6930 return; | 6930 return; |
6931 | 6931 |
6932 DW_MUTEX_LOCK; | 6932 DW_MUTEX_LOCK; |
7027 fontname = dw_window_get_font(handle); | 7027 fontname = dw_window_get_font(handle); |
7028 free_fontname = 1; | 7028 free_fontname = 1; |
7029 } | 7029 } |
7030 } | 7030 } |
7031 else if(pixmap) | 7031 else if(pixmap) |
7032 fontname = (char *)g_object_get_data(G_OBJECT(pixmap->handle), "_dw_fontname"); | 7032 { |
7033 if(pixmap->font) | |
7034 fontname = pixmap->font; | |
7035 else if(pixmap->handle) | |
7036 fontname = (char *)g_object_get_data(G_OBJECT(pixmap->handle), "_dw_fontname"); | |
7037 } | |
7033 | 7038 |
7034 font = pango_font_description_from_string(fontname ? fontname : "monospace 10"); | 7039 font = pango_font_description_from_string(fontname ? fontname : "monospace 10"); |
7035 if(font) | 7040 if(font) |
7036 { | 7041 { |
7037 PangoContext *context = gdk_pango_context_get(); | 7042 PangoContext *context = gdk_pango_context_get(); |