summaryrefslogtreecommitdiff
path: root/pango/pangocairo-win32font.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2008-12-06 01:44:03 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2008-12-06 01:44:03 +0000
commit1ec099a51c7faec59e4b639cea95d08faf886615 (patch)
tree5cbadfb1747c90ac967b44b83a753efcc4dc338e /pango/pangocairo-win32font.c
parent74cc07c44afd2879418389cce57a4129b60d61e6 (diff)
downloadpango-1ec099a51c7faec59e4b639cea95d08faf886615.tar.gz
Bug 563356 – The input area of firefox and the blank width after text in
2008-12-05 Behdad Esfahbod <behdad@gnome.org> Bug 563356 – The input area of firefox and the blank width after text in gnome-menu was stretched too wide, under pango-1.22.3 * docs/tmpl/fonts.sgml: * pango/pango-impl-utils.h: * pango/pangocairo-atsuifont.c (pango_cairo_atsui_font_create_metrics_for_context): * pango/pangocairo-win32font.c (pango_cairo_win32_font_create_metrics_for_context): * pango/pangofc-font.c (pango_fc_font_create_metrics_for_context): For approximate_char_width calculation take each char's width into account. That is, do a weighted average instead of uniform average. g_unichar_iszerowidth() chars count as 0, g_unichar_iswide() chars count 2, and the rest count as 1. Pretty much wcwidth() behavior. See bug report for rationale. svn path=/trunk/; revision=2747
Diffstat (limited to 'pango/pangocairo-win32font.c')
-rw-r--r--pango/pangocairo-win32font.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pango/pangocairo-win32font.c b/pango/pangocairo-win32font.c
index 875f9526..4dda4ece 100644
--- a/pango/pangocairo-win32font.c
+++ b/pango/pangocairo-win32font.c
@@ -150,7 +150,7 @@ pango_cairo_win32_font_create_metrics_for_context (PangoCairoFont *font,
pango_layout_set_text (layout, sample_str, -1);
pango_layout_get_extents (layout, NULL, &extents);
- metrics->approximate_char_width = extents.width / g_utf8_strlen (sample_str, -1);
+ metrics->approximate_char_width = extents.width / pango_utf8_strwidth (sample_str);
pango_layout_set_text (layout, "0123456789", -1);
metrics->approximate_digit_width = max_glyph_width (layout);