diff options
author | 2010-08-11 20:59:59 +0200 | |
---|---|---|
committer | 2010-08-11 20:59:59 +0200 | |
commit | 36b14449d71b14e29358560894d6ed94d7adedc1 (patch) | |
tree | ea802b8817c3984e3b6cc6c8058f95e5f6df861c /plugins/gtkui/gdkdrawing.c | |
parent | f4bea1b47ad7cf1a1e1c1cecaf47d78583abcf64 (diff) |
fixed bold font text drawing bug
Diffstat (limited to 'plugins/gtkui/gdkdrawing.c')
-rw-r--r-- | plugins/gtkui/gdkdrawing.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/gtkui/gdkdrawing.c b/plugins/gtkui/gdkdrawing.c index b914b70b..27174fa7 100644 --- a/plugins/gtkui/gdkdrawing.c +++ b/plugins/gtkui/gdkdrawing.c @@ -92,6 +92,7 @@ draw_rect (float x, float y, float w, float h, int fill) { } static GtkStyle *font_style = NULL; +static PangoWeight font_weight = PANGO_WEIGHT_NORMAL; void draw_init_font (GtkStyle *new_font_style) { @@ -111,6 +112,7 @@ draw_init_font (GtkStyle *new_font_style) { pangolayout = pango_layout_new (pangoctx); pango_layout_set_ellipsize (pangolayout, PANGO_ELLIPSIZE_END); PangoFontDescription *desc = font_style->font_desc; + font_weight = pango_font_description_get_weight (desc); pango_layout_set_font_description (pangolayout, desc); pango_ready = 1; } @@ -128,6 +130,12 @@ draw_init_font_bold (void) { pango_font_description_free(desc); } +void +draw_init_font_normal (void) { + pango_font_description_set_weight (font_style->font_desc, font_weight); + pango_layout_set_font_description (pangolayout, font_style->font_desc); +} + float draw_get_font_size (void) { |