Text in QML rendered different accross platforms

后端 未结 1 1960
旧巷少年郎
旧巷少年郎 2021-01-06 05:14

I am seeing inconsistencies in the rendering of text between different platforms:

The image on the top left is produced in android, and as the red guide lin

相关标签:
1条回答
  • 2021-01-06 05:59

    It turns out that it is a bug. So it will likely be fixed sometime in the years to come...

    Until then, the following workaround should do the trick at least when it comes to the vertical position:

      property real offset: {
        switch (Qt.platform.os) {
        case "android": return androidValue
        case "windows": return windowsValue
        // and so on...
        }
      }
    

    I will investigate if there are discrepancies between different version of the same platforms and update the answer if necessary.

    UPDATE: It may turn out that the exception here is windows, as the output from android and ubuntu is practically identical (and yes, both are essentially linux anyway). I don't have a mac so I cannot give any input on that.

    0 讨论(0)
提交回复
热议问题