GNOME Bugzilla – Bug 560914
Text areas in gecko are wider in Japanese locale
Last modified: 2009-01-06 12:17:41 UTC
This bug was originally reported on the Debian BTS: http://bugs.debian.org/505780 There are (ugly) screenshots if you find my explanations unclear. Compared to pango 1.20, version 2.22 seems to compute correctly the width required to type a text in a given language for a given size. The result is, in Firefox, that the text input field is now wider when you use a Japanese locale (or any locale where the average character width is large). I see this as an improvement, the problem is that websites don’t bother to reduce the width of their input fields depending on the language, even if a typical query in Japanese is half the number of characters of an English one. For example Google always uses a width of 55. (Even worse is the fact that Gecko relies on the system locale and not the webpage’s one, but this is not an issue in pango itself.)
Fixed for a while: 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.