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

Labels are rendered too small on high DPI devices #8

Closed
boardend opened this issue Oct 24, 2023 · 4 comments
Closed

Labels are rendered too small on high DPI devices #8

boardend opened this issue Oct 24, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@boardend
Copy link
Collaborator

I have observed that labels get rendered in different sizes depending on the browser used (Chromium 118.0.5993.88 / Firefox 119.0b9) on my system (Ubuntu 22.04, Wayland, Scale 150%).

Also @andreasneumann reported that this test project is rendered with smaller labels than on QGIS Desktop.

Probably we have to set qtFontDpi depending on the devicePixelRatio property.

See also https://doc.qt.io/qt-6/highdpi.html

@boardend boardend added the bug Something isn't working label Oct 24, 2023
@boardend boardend changed the title Labels are rendered to small on high DPI devices Labels are rendered too small on high DPI devices Oct 24, 2023
@wonder-sk
Copy link
Member

It is also worth checking whether size of map symbols (point size, line width) is correct - e.g. when you set 1cm point size symbol on desktop QGIS, whether it will be 1cm on screen also in the browser.

Some things I would try to fix DPI issues:

  • QgsMapSettings::setDevicePixelRatio()
  • QgsMapSettings::setOutputDpi()

@andreasneumann
Copy link
Member

andreasneumann commented Oct 24, 2023

It is a bit hard to tell - but Martin could be right. It could be that the whole symbology and not just the labels are affected.

grafik

Here is a screenshot showing the symbology in wasm (left) and QGIS Desktop (right).

I have the impression that in QGIS Desktop point symbol sizes and stroke-widths are also a bit larger - but it is a bit hard to tell.

@boardend
Copy link
Collaborator Author

boardend commented Nov 6, 2023

This is fixed and ready to be tested on https://qgis.github.io/qgis-js

I did some tests with Ubuntu 22.04 on Wayland (150% and 200% scale) and X11 (200% scale) in latest Firefox and Chromium.

@andreasneumann could you do a test on Windows?

Maybe this fixes also #9, otherwise I would have a look at this next.

@andreasneumann
Copy link
Member

The current version looks fine to me. I think we can close this issue.

@boardend boardend closed this as completed Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants