From 1ec099a51c7faec59e4b639cea95d08faf886615 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 6 Dec 2008 01:44:03 +0000 Subject: =?UTF-8?q?Bug=20563356=20=E2=80=93=20The=20input=20area=20of=20fi?= =?UTF-8?q?refox=20and=20the=20blank=20width=20after=20text=20in?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-12-05 Behdad Esfahbod 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 --- docs/tmpl/fonts.sgml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/tmpl/fonts.sgml b/docs/tmpl/fonts.sgml index 460e60b8..4b91624b 100644 --- a/docs/tmpl/fonts.sgml +++ b/docs/tmpl/fonts.sgml @@ -441,7 +441,10 @@ of their meaning. @descent: the distance from the baseline to the lowest point of the glyphs of the font. This is positive in practically all fonts. @approximate_char_width: approximate average width of the regular glyphs of - the font. + the font. Note that for this calculation, East Asian characters + (those passing g_unichar_iswide()) are counted as double-width. + This produces a more uniform value for this measure across languages + and results in more uniform and more expected UI sizes. @approximate_digit_width: approximate average width of the glyphs for digits of the font. @underline_position: position of the underline. This is normally negative. -- cgit v1.2.1