New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 632291 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

css 'font:menu' uses a wrong scaled font-size on hi-dpi systems (Windows)

Reported by m...@krpano.com, Jul 28 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0

Example URL:
http://krpano.com/chrome/bugs/hidpi/css-font-menu-bug.html

Steps to reproduce the problem:
Test this page on a hi-dpi Windows system:

http://krpano.com/chrome/bugs/hidpi/css-font-menu-bug.html

(see also the source of that page, it's pretty simple)

What is the expected behavior?
The same relative font-size as when using 100% dpi.

Firefox is correct - see the attached screenshots.

What went wrong?
The font=menu font-size is wrong.
And the button font/size is also wrong.

It seems internally the font-size itself also gets scaled by the DPI-scale, but that's unnecessary and wrong - the page itself already will be scaled, so there is double-scale now.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? N/A 

Chrome version: 52  Channel: n/a
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: 

Tested only on Windows.
Firefox is correct.
Edge is also broken (will report too).
 
chrome.png
246 KB View Download
firefox.png
103 KB View Download

Comment 1 by kojii@chromium.org, Jul 29 2016

Labels: Needs-Feedback
Could you please tell us how many monitors do you have?

I tested the URL on my Win10, with both hi-dpi and lo-dpi monitors attached, and cannot reproduce on either monitors. I'd like to clarify if this is Win7 only issue or related with monitor configurations.

Comment 2 by m...@krpano.com, Jul 29 2016

The screenshots above are from Windows 10 PC with basically only one 4k monitor attached (and an HTC Vive, but I don't know if that counts internally as monitor),

but I'm getting the same problem also on a 4k laptop with definitively no monitor attached.

What were your Windows DPI settings during testing?

Comment 3 by m...@krpano.com, Jul 29 2016

As additional note - on a default Windows 10 system the font-size for font=menu should be always 12px, regardless of the DPI settings.

At the moment that font-size gets (wrongly) scaled by the DPI scale in Chrome,
e.g.
DPI = 100% => font-size:12px
DPI = 150% => font-size:18px
DPI = 200% => font-size:24px
DPI = 300% => font-size:36px

Comment 4 by m...@krpano.com, Jul 29 2016

One more idea - depending on how Chrome gets the system font sizes - it could be also that the system itself is reporting the scaled font-sizes...

In this case Chrome would need to scale them back...
Components: -Blink Blink>Fonts
Project Member

Comment 6 by sheriffbot@chromium.org, Aug 11 2016

Labels: -Needs-Feedback Needs-Review
Owner: kojii@chromium.org
Thank you for providing more feedback. Adding requester "kojii@chromium.org" for another review and adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 7 by m...@krpano.com, Aug 11 2016

Why is this bug still unconfirmed?
It's pretty easy to reproduce - just use a Windows system with a non 100% DPI setting and view the test link...

Comment 8 by kojii@chromium.org, Aug 12 2016

Labels: -Needs-Review Needs-Feedback
Sorry I forgot to add myself as cc, missed your replies.

Could you try on the latest Canary? We have hi-dpi fixes a few days ago, and I can no longer reproduce this.

Note, I don't have hi-dpi monitor right now, but tested by changing DPI on Win 10.

Comment 9 by m...@krpano.com, Aug 13 2016

Hi, I'm testing this with Chrome Version 54.0.2827.0 canary (64-bit) now - and the bug is still there (no difference at all).

Btw - see also the attached screenshot - it's was made in Canary during tying this text and it shows another DPI problem - the font size in this comment field here is also wrong (my system: Windows 10, 300% DPI).
Screenshot (1).png
843 KB View Download
Project Member

Comment 10 by sheriffbot@chromium.org, Aug 20 2016

Labels: -Needs-Feedback Needs-Review
Thank you for providing more feedback. Adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 11 by kojii@chromium.org, Aug 22 2016

Labels: -Needs-Review Needs-TestConfirmation
Is there someone who can confirm this?

It does not reproduce on Win10 hi-dpi, probably this is win7 only issue but I don't have win7.

Comment 12 by m...@krpano.com, Aug 22 2016

All screenshots from above are showing Win10!
That means the bug is on Win10, not sure about Win7.

The info 'OS Version: 6.1 (Windows 7' in the first post is wrong - the bug-report was written on a Win7 system, but the tests were done on Win10).

About not being able to reproduce - how do you test?

I would recommend setting the Windows DPI scale to a high value (e.g. 300% like in the screenshots) to make the problem more clear and then compare this page:

http://krpano.com/chrome/bugs/hidpi/css-font-menu-bug.html

between Chrome and Firefox (Firefox is rendering correctly).

And please post a screenshot from your system about that test case. It would be very strange when it wouldn't be affected...

Comment 13 by e...@chromium.org, Aug 22 2016

Cc: kojii@chromium.org
Owner: osh...@chromium.org
Status: Assigned (was: Unconfirmed)
Confirmed on windows 10 high DPI on both stable and canary.

Oshima, could this be due to your scaling changes?

Comment 14 by kojii@chromium.org, Aug 23 2016

My screenshot in case this helps analysis
632291-hidpi.png
74.5 KB View Download

Comment 15 by m...@krpano.com, Aug 23 2016

@kojii - your screenshot is even more strange - it say font-family=Segoe UI, but the font on the page is rendered with something that looks like 'Times New Roman'...

Could this maybe be related somehow to multiple monitors?
What's the DPI setting on the other ones?

In my tests (with one desktop and one tablet system) always only one monitor was attached.
Labels: -Needs-TestConfirmation M-55
Able to reproduce the issue on win10 chrome version 52.0.2743.116 and 55.0.2843.0 - observed font-size vary with high DPI.
DPI = 200% => font-size:24px

Working fine with firefox browser

Please find the screenshots for chrome and firefox browsers

This is a non regression issue existing since M45 builds 45.0.2454.99 to latest canary

632291.png
137 KB View Download
632291firefox.png
100 KB View Download
Issue can be seen from M41 (41.0.2272.40) builds to latest canary. The prior builds doesnt display anything under font-family and font-size as shown in the screenshot
M40 and before builds.png
158 KB View Download

Comment 18 by m...@krpano.com, Aug 30 2016

Just as note - the MS Edge browser has the same (or at least a similar) problem as Chrome.

So the problem might be the Windows API for getting the font-size. That means the font-size might be already scaled and Chrome would need to 'scale-back' by the DPI scale to get the correct size...
Owner: bsep@chromium.org
Works fine on chromeos, so this is probably windows specific (as mentioned in -#18).

bsep@ can you look into this?

Comment 20 by bsep@chromium.org, Sep 1 2016

Components: UI>HighDPI
Labels: Hotlist-Win10FrontendPolish
I'll look into this when I have time.

Comment 21 by bsep@chromium.org, Sep 20 2016

Owner: kulshin@chromium.org
Reassigning to someone who knows more about fonts.
Status: Available (was: Assigned)
Cc: kulshin@chromium.org
Owner: bsep@chromium.org
When I debugged this, I noticed that it was getting the menu font size from preferences in RenderViewImpl::UpdateFontRenderingFromRendererPrefs, when it calls blink::WebFontRendering::setMenuFontMetrics. At that point, it is already getting the scaled font size. The fix might be as simple as un-scaling prefs.menu_font_height before handing it to blink. I haven't yet reviewed what else uses that pref, but if it's only used for blink::WebFontRendering::setMenuFontMetrics it probably makes more sense to just store that pref as an un-scaled value. I haven't yet tracked down where that pref is being set.

Comment 24 by e...@chromium.org, Sep 8 2017

The *button* font now gets the correct size but the menu font is still wrong.
Status: Assigned (was: Available)

Sign in to add a comment