Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Linux] How to enable sub-pixel rendering for Qt Quick/QML 6.5.3?
Forum Updated to NodeBB v4.3 + New Features

[Linux] How to enable sub-pixel rendering for Qt Quick/QML 6.5.3?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 127 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hawky
    wrote 24 days ago last edited by
    #1

    Hi!

    (I'd to remove relevant information due to be marked as Spam by Aksmet .com)

    We've problems enablling sub-pixel rendering for Qt Quick/QML.

    First of all we're using Qt 6.5.3 and sub-pixel rendering is system wide enabled via font-config.

    To verify that sub-pxel rendering works at all with a native Qt application we've used fontsampler example:

    fontsampler.jpg

    Nevertheless we're unable to enable sub-pixel rendering for Qt Quick/QML. To verify that we've used the textexample from qtdeclarative:

    textexample.jpg

    From what we've read Qt Quick/QML can render text in various ways:

    • QtTextRendering
    • NativeTextRendering
    • CurveTextRendering (since 6.7.0)

    Qt Quick/QML is using QtTextRendering per default. So to change the default behavior and to enable native rendering (which will enable sub-pixel rendering hopefully as well) one can either

    • Call setTextRenderType()
    • Build qtdeclarative with different build options as mentioned here and here. But with a different keyword: "NativeTextRendering" insteadof "NativeRendering" as mentioned here.

    However, none of both of options enabled sub-pixel rendering in our case, even if sub-pixel rendering works with native Qt.

    To verify that our changes really applied we added a short code snippet to our Qt Quick/QML application:

    qInfo("QQuickWindow::QtTextRendering = 0x%x", QQuickWindow::QtTextRendering);
    qInfo("QQuickWindow::NativeTextRendering = 0x%x", QQuickWindow::NativeTextRendering);
    qInfo("old render type = 0x%x", window->textRenderType());
    window->setTextRenderType(QQuickWindow::NativeTextRendering);
    qInfo("new render type = 0x%x", window->textRenderType());
    

    The output is on the first option:

    QQuickWindow::QtTextRendering = 0x0
    QQuickWindow::NativeTextRendering = 0x1
    old render type = 0x0
    new render type = 0x1
    

    and on the second option:

    QQuickWindow::QtTextRendering = 0x0
    QQuickWindow::NativeTextRendering = 0x1
    old render type = 0x1
    new render type = 0x1
    

    So our changes apply but sub-pixel rendering is not enabled/visible.

    How can we enable sub-pixel rendering with an Qt Quick/QML application?

    Thank you!

    1 Reply Last reply
    0

    1/1

    26 May 2025, 13:42

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved