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

Problems displaying fonts in 4k monitors #837

Closed
lornat75 opened this issue Jul 29, 2016 · 14 comments
Closed

Problems displaying fonts in 4k monitors #837

lornat75 opened this issue Jul 29, 2016 · 14 comments

Comments

@lornat75
Copy link
Member

lornat75 commented Jul 29, 2016

All guis have problems displaying fonts in high-res monitors.

The problems is probably this one:
http://doc.qt.io/qt-5/highdpi.html

can be fixed by adding qputenv("QT_DEVICE_PIXEL_RATIO", QByteArray("2")); in the main.

Thanks @aitek4iit

@lornat75
Copy link
Member Author

Checking the documentation more carefully we need to ensure that the line:

qputenv("QT_DEVICE_PIXEL_RATIO",QByteArray("2"));

does not cause problems to systems with low-resolution. More importantly this feature is deprecated in qt 5.6, so we need to make it version specific and remove it once we stop supporting qt 5.4 and (probably) 5.5.

@lornat75
Copy link
Member Author

lornat75 commented Jul 31, 2016

These commits have been reverted because did mess up the visualization on normal screens. As reported by @pattacini for testing. They did work on my VM Linux unbuntu 10.04.

@lornat75
Copy link
Member Author

Looks like the safest solution at the moment is to leave to the user to set the environment variable:

QT_DEVICE_PIXEL_RATIO = 2

This can be done at the system level (recommended) in the control panel or on each terminal.

@lornat75
Copy link
Member Author

lornat75 commented Jul 31, 2016

Proper fix should be done using new features in qt-5.6.

@mbrunettini maybe in the next release of the binaries we should replace qt-5.4 with qt-5.6 .

@drdanz, @aitek4iit what do you think?

@pattacini
Copy link
Member

Quick update: together with @lornat75 we've tested that QT_DEVICE_PIXEL_RATIO = auto works for both high-res and normal systems.

lornat75 added a commit to lornat75/yarp that referenced this issue Jul 31, 2016
…uis. Not touching yarpscope because it already works fine and yarpmanager++ because this settings badly affects the graphical representation of the applications.
lornat75 added a commit to lornat75/yarp that referenced this issue Jul 31, 2016
…uis. Not touching yarpscope because it already works fine and yarpmanager++ because this settings badly affects the graphical representation of the applications.
lornat75 added a commit to lornat75/yarp that referenced this issue Jul 31, 2016
…uis. Not touching yarpscope because it already works fine and yarpmanager++ because this settings badly affects the graphical representation of the applications.
lornat75 added a commit to lornat75/yarp that referenced this issue Jul 31, 2016
…uis. Not touching yarpscope because it already works fine and yarpmanager++ because this settings badly affects the graphical representation of the applications.
lornat75 added a commit to lornat75/yarp that referenced this issue Jul 31, 2016
…uis. Not touching yarpscope because it already works fine and yarpmanager++ because this settings badly affects the graphical representation of the applications.
@lornat75
Copy link
Member Author

@pattacini I have updated the pull request, would you mind give it a try?

pattacini added a commit that referenced this issue Jul 31, 2016
fixing #837 setting QT_DEVICE_PIXEL_RATIO = auto for some guis.
@pattacini
Copy link
Member

pattacini commented Jul 31, 2016

@lornat75 it works nicely; just merged!

(devel updated too)

@lornat75
Copy link
Member Author

Ok. Thanks, leaving this open until we fix the problem in Qt 5.6 using appropriate functions.

@mbrunettini
Copy link
Member

Ok, I will update to Qt 5.6 where it is supported.

@aitek4iit
Copy link
Collaborator

Yes the AUTO flag should do the trick for both resolution and I think Qt 5.6 wolud manage better the high dpi resolutions beacuse in the 5.4 version this feature was only a beta.

@mbrunettini
Copy link
Member

QT 5.6 is only avavilabe on windows with the following versions:
-VS 2013 (V12) 32 and 64 bit
-VS 2015 (V14) 32 and 64 bit

@claudiofantacci
Copy link
Collaborator

claudiofantacci commented Dec 19, 2016

I'm writing here concerning about QT_DEVICE_PIXEL_RATIO qtputenv option.

Under macOS, QT version 5.7.0 (from brew), launching yaprdataplayer, yaprview, yarpmotorgui, the following warning is raised:

Warning: QT_DEVICE_PIXEL_RATIO is deprecated. Instead use: 
    QT_AUTO_SCREEN_SCALE_FACTOR to enable platform plugin controlled per-screen factors. 
    QT_SCREEN_SCALE_FACTORS to set per-screen factors. 
    QT_SCALE_FACTOR to set the application global scale factor.

Probably QT_AUTO_SCREEN_SCALE_FACTOR set to 1 (boolean true) will make the job done.

Ref: http://doc.qt.io/qt-5/highdpi.html#high-dpi-support-in-qt

@drdanz
Copy link
Member

drdanz commented Dec 20, 2016

@claudiofantacci Opened a new issue, see #1038

@Nicogene
Copy link
Member

Nicogene commented May 8, 2017

Changes introduced in #1200 should solve, for now I close this issue, if someone encounter some problems I will re-open it

@Nicogene Nicogene closed this as completed May 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment