[Solved] Managing font size at Mac and Windows



  • Hi together,

    the problem is the well known and good described 72dpi at Mac and 96dpi at Windows problem. I have found a lot of discussion to this theme.
    But I have not found a document what describes how can a handle this. I need a description what I have to do that the displayed font has the same high at different systems. Please also cover QML. Is there a global setting in Qt 5.1?
    I'm sure there is a solution but I haven't found it, sorry.

    Thanks



  • I have solved the problem for our application by creating a factor which is used in every font.size declaration.
    This property is computed during the startup of the application by using the logicalDpiY from the QApplication::desktop() parameter.

    @QQuickView viewer;
    viewer.rootContext()->setContextProperty("fontFactor",
    72.0/QApplication::desktop()->logicalDpiY());@

    The number 72.0dpi is used, because the GUI-Development is made at a MAC.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.