Bug 397752 - HTML articles appear very small
Summary: HTML articles appear very small
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: internal browser (show other bugs)
Version: 5.9.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-22 16:09 UTC by Matthijs Tijink
Modified: 2021-02-08 23:44 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Remove pointsToPixel conversion (834 bytes, patch)
2020-11-25 11:27 UTC, Lukáš Turek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthijs Tijink 2018-08-22 16:09:40 UTC
Since the latest version, all web articles appear very small (those with "show full webpage" ticked). Normal articles appear in the correct font size.

I think I have to zoom to about 200% for a normal-ish view (similar to old size/Firefox/Chrome).

Possibly related bug: 361588

(Fixing bug 375119 would be an usable workaround)
Comment 1 Lukáš Turek 2018-12-19 14:05:24 UTC
I have the same problem, but only on some feeds (websites): those that don't set fixed font size (in pt or px), but use relative units (em or rem).

I think it happens because QWebEngineSettings::DefaultFontSize expects the size in pixels, not points. However, GrantleeViewFormatter converts the configured Medium Font Size from points to pixels. This inconsistency means that depending on what Medium Font Size you set, you will either have normal fonts on websites and huge fonts in feeds, or tiny fonts on websites and normal fonts in feeds.

The simplest fix would be to drop the conversion in GrantleeViewFormatter, but that would change font size in feeds for current users.
Comment 2 Justin Zobel 2020-11-25 00:20:51 UTC
Thanks for the report. As it's been a little while since this report was received can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved. I've set the bug status to "needsinfo" pending your response, please change back to "reported" or "resolved" when you respond, thanks.
Comment 3 Lukáš Turek 2020-11-25 11:27:53 UTC
Created attachment 133639 [details]
Remove pointsToPixel conversion
Comment 4 Lukáš Turek 2020-11-25 11:31:20 UTC
I didn't test 20.08.3 yet, but the attached patch fixes the problem for me in 20.04.3 and it would apply to current GIT.
Comment 5 Justin Zobel 2020-11-26 01:07:21 UTC
(In reply to Lukáš Turek from comment #3)
> Created attachment 133639 [details]
> Remove pointsToPixel conversion

Lukáš can you please submit this as a merge request to https://invent.kde.org/pim/akregator
Comment 6 Laurent Montel 2020-11-26 06:06:23 UTC
(In reply to Lukáš Turek from comment #1)
> I have the same problem, but only on some feeds (websites): those that don't
> set fixed font size (in pt or px), but use relative units (em or rem).
> 
> I think it happens because QWebEngineSettings::DefaultFontSize expects the
> size in pixels, not points. However, GrantleeViewFormatter converts the
> configured Medium Font Size from points to pixels. This inconsistency means
> that depending on what Medium Font Size you set, you will either have normal
> fonts on websites and huge fonts in feeds, or tiny fonts on websites and
> normal fonts in feeds.
> 
> The simplest fix would be to drop the conversion in GrantleeViewFormatter,
> but that would change font size in feeds for current users.

"src/akregator_part.cpp:684:    QWebEngineSettings::defaultSettings()->setFontSize(QWebEngineSettings::DefaultFontSize, Settings::mediumFontSize());"
=> we use correct settings in QWebEngineSettings::defaultSettings() we don't convert it.

In grantlee html file wr use "grantleeObject.insert(QStringLiteral("mediumFontSize"), pointsToPixel(Settings::mediumFontSize()));"
because
"rc/formatter/html/5.2/combinedview.html:9:    font-size: {{ mediumFontSize}}px ! important;
src/formatter/html/5.2/combinedview.html:65:    font-size: {{mediumFontSize}}px;
src/formatter/html/5.2/combinedview.html:70:    font-size: {{ mediumFontSize}}px;
src/formatter/html/5.2/defaultnormalvisitfeed.html:8:    font-size: {{ mediumFontSize}}px ! important;
src/formatter/html/5.2/defaultnormalvisitfolder.html:8:    font-size: {{ mediumFontSize}}px ! important;
src/formatter/html/5.2/normalview.html:8:    font-size: {{ mediumFontSize}}px ! important;
src/formatter/html/5.2/normalview.html:50:    font-size: {{ mediumFontSize}}px;
src/formatter/html/5.2/normalview.html:55:    font-size: {{ mediumFontSize}}px;
"
we use px on html directly.

Which resolution do you use ? 4K ?
Comment 7 Lukáš Turek 2020-11-26 11:51:17 UTC
I have a 1920x1200 display with DPI set to 110, which is still much more than 72 DPI where pixels and points match. I set Medium font size in Akregator to 16, which is the desired value in pixels, roughly matching 10pt set in KDE. QWebEngineSettings::setFontSize also expects the font size in pixels, so the conversion should be either in both places, or none. I chose the latter option, because the font sizes in Akregator then match values in Falkon.
Comment 8 Bug Janitor Service 2020-12-11 04:34:00 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 9 Christoph Feck 2020-12-11 17:40:21 UTC
New information was added with comment 7 and earlier; changing status for inspection.
Comment 10 Bug Janitor Service 2021-01-23 12:10:03 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/akregator/-/merge_requests/8
Comment 11 Albert Astals Cid 2021-02-08 23:44:46 UTC
Git commit b665d515cb025cbad11ff129aed8fe0467d9f476 by Albert Astals Cid, on behalf of Lukáš Turek.
Committed on 08/02/2021 at 23:30.
Pushed by aacid into branch 'master'.

Fix Bug 397752 - HTML articles appear very small

GrantleeViewFormatter converts user configured font size from points
to pixels, but there's no such conversion in AkregatorPart, where
QWebEngineSettings::setFontSize also expects the font size in pixels.
As a result fonts on sites using relative units (em or rem) are small,
unless DPI is close to 72. The point to pixel conversion should be
either in both places, or none. I chose the latter option, because
then the font sizes in Akregator match values in Falkon.

M  +1    -1    src/formatter/grantleeviewformatter.cpp

https://invent.kde.org/pim/akregator/commit/b665d515cb025cbad11ff129aed8fe0467d9f476