RESOLVED INVALID 29430
[Qt] QWebView font size formatting through CSS does not match Qt's native font sizes
https://bugs.webkit.org/show_bug.cgi?id=29430
Summary [Qt] QWebView font size formatting through CSS does not match Qt's native fon...
Tor Arne Vestbø
Reported 2009-09-18 07:45:00 PDT
This bug report originated from issue QTBUG-3326 <http://bugreports.qt.nokia.com/browse/QTBUG-3326> --- Description --- If the text in the HTML of a QWebView is formatted using a cascading style sheet to change the size, then the size of the text differs from what you get when using the same values to contruct a QFont and use this to render text in another Qt widget such as a QTextEdit.
Attachments
Testcase (819 bytes, text/x-c++src)
2010-03-17 08:29 PDT, Kent Hansen
no flags
Diego Gonzalez
Comment 1 2010-03-16 12:37:24 PDT
Is this a specific Mac OS bug?
Tor Arne Vestbø
Comment 2 2010-03-17 08:28:54 PDT
Confirmed in trunk. AFAIK webkit assumes 96dpi, could this be the issue?
Kent Hansen
Comment 3 2010-03-17 08:29:57 PDT
Created attachment 50909 [details] Testcase I'm bored, so I made this testcase.
Kent Hansen
Comment 4 2010-03-17 08:32:16 PDT
It's not Mac-specific, I see it on Linux.
kasthuri
Comment 5 2011-01-11 11:01:09 PST
The problem seems to be with the test case. QFont constructor assumes font size to be in terms of number of points. But the CSS part in the test case is setting the font-size in terms of number of pixels. That's why we are seeing the difference in displayed text size. So if we set the CSS font-size to be "40pt" or set the QFont size in terms of pixels explicitly, QFont fnt("Arial"); fnt.setPixelSize(40); then the displayed texts have the same size.
Noam Rosenthal
Comment 6 2012-07-11 14:59:49 PDT
Closing this 2-year-old bug, the problem is with the test case.
Note You need to log in before you can comment on or make changes to this bug.