Closed Bug 1063876 Opened 11 years ago Closed 11 years ago

Minimum sizes for url bar are very large with some fonts, causing other content to be overflown out of the nav-bar

Categories

(Firefox :: Theme, defect)

All
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: glandium, Unassigned)

References

Details

Attachments

(1 file)

See attached screenshot. The window on the left is a en-US Firefox 32 launched with a en_US.UTF-8 locale. The window on the right is a en-US Firefox 32 launched with a ja_JP.UTF-8 locale. The search box doesn't appear for windows width < 1056, and it takes 1203 pixels before all the icons show up. Actually, those sizes are not even consistent: when increasing the horizontal size, it takes a certain amount before the icons or the search box show up, but once they are shown, it is possible to decrease the width to some degree. But not enough to have them show up on half-screen-width window like when running on en_US. With a window < 827 pixels, the awesomebar starts being eaten on its right end, which only happens, when running the en_US.UTF-8 locale, for windows < 331 pixels.
Attached image Screenshot
This apparently comes from http://hg.mozilla.org/mozilla-central/annotate/25efb1b16a5e/browser/base/content/browser.css#l317 50ch computes as 750px with the ja_JP.UTF-8 locale, and 450.833px with the en_US.UTF-8 locale.
It blows my mind that ch has a different meaning base on the system locale as opposed to UI locale.
https://developer.mozilla.org/en/docs/Web/CSS/length also says this about the "ch" unit: This unit represents the width, or more precisely the advance measure, of the glyph '0' (zero, the Unicode character U+0030) in the element's font. In both locales, the computed font-family is Cantarell, and the font-size is 14.6667px, and in both cases 50 zeros printed in the urlbar itself (which font-family and font-size is the same as the urlbar-container) takes the same amount of space, and that amount of space is 450 pixels.
It also seems this doesn't affect content (a 50ch div in an html file has the same width in both cases)
So, apparently, those calculations are done with DroidSansJapanese.ttf when the locale is japanese...
So, I think there are two problems hidden here: - 50ch is ridiculously large as a min-width for some fonts - We're not computing 1ch with the same font as the one actually displayed. In my case, with the japanese locale, the computation is done with DroidSansJapanese, and the display with either Cantarell-Regular or DroidSansFallback, I'm not entirely sure which one. With the en_US locale, both computation and display are done with Cantarell-Regular.
Filed the latter as bug 1063891
(In reply to Mike Hommey [:glandium] (out from Sep 6 to Sep 22) from comment #5) > It also seems this doesn't affect content (a 50ch div in an html file has > the same width in both cases) We probably declare a font: for the browser's UI. You should be able to check with the browser toolbox (enable chrome/remote debugging in the devtools, then use tools > web developer > Browser toolbox and inspect / use the style editor). Different fonts, as you already figured out, have different ch widths.
Blocks: 870463
Summary: Search box and the icons on its right, up to but excluding the menu button, are hidden when running on some locales → Minimum sizes for url bar are very large on some locales, causing other content to be overflown out of the nav-bar
Component: Toolbars and Customization → Theme
According to the inspector, the font is message-box in common.css, and is computed to Cantarell, as mentioned above. That the metrics for that font are wrong is now bug 1063891.
At this point, what locales is this bug about? In what respect is this not a duplicated of bug 1063891?
At this point, the bug is about the fact that 50ch is ridiculously large for some fonts. Bug 1063891 is about the underlying issue that the font metrics are wrong in some cases, that is, that 1ch is actually larger than what it actually is for the given font. It doesn't change the fact that there *are* fonts where 1ch is large.
As long as those fonts aren't used by default somewhere, I don't think we need to worry about this. To some extent I think it's obvious that if you configure your OS to use an oversized font, less content is going to fit on your screen.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Summary: Minimum sizes for url bar are very large on some locales, causing other content to be overflown out of the nav-bar → Minimum sizes for url bar are very large with some fonts, causing other content to be overflown out of the nav-bar
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: