Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webenginepreview: font size should be in pixels #609

Closed
char101 opened this issue Feb 4, 2023 · 1 comment
Closed

webenginepreview: font size should be in pixels #609

char101 opened this issue Feb 4, 2023 · 1 comment

Comments

@char101
Copy link

char101 commented Feb 4, 2023

Hi,

setFontSize in this line uses pixels not points so this line should be

settings.setFontSize(QWebEngineSettings.FontSize.DefaultFontSize,
font.pointSize())

settings.setFontSize(QWebEngineSettings.FontSize.DefaultFontSize,
                     int(font.pointSize() * QGuiApplication.primaryScreen().physicalDotsPerInch() / 72))
@mitya57
Copy link
Member

mitya57 commented Feb 19, 2023

Thank you very much for your report!

I fixed this in a bit different way. Your suggestion makes the font too large on my display, while with QFontInfo::pixelSize() the size in QTextEdit and WebEngine previews is the same.

mitya57 added a commit that referenced this issue May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants