Results 1 to 9 of 9

Thread: Qt renders wrong font

  1. #1
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    84
    Thanks
    5
    Thanked 5 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt renders wrong font

    Hello,
    I happened to notice that Qt behaves slightly different than it's supposed to. I'm using Qt 4.2.1 on Windows XP SP2.
    If I use the standard Blue Luna theme on Windows XP Qt's font rendering looks exactly like it should. However, if I change to a custom theme where the theme uses a anti-aliased font Qt still uses the old standard pixel font, even though all my programs on Windows (Firefox, Thunderbird, Nero, Internet Explorer, Windows Explorer etc.) display the new smooth font.

    Here's a screenshot from the Windows Explorer (top: Blue Luna; bottom: Custom Skin with smooth font)


    Qt displays it still like this:


    However, Qt manages to display all QMenu(s) and QMessageBox(es) with the new smooth font (screenshot taken from the about box of Qt Assistant):


    So, when I switch to the custom theme, Firefox and all my other Windows programs use this new smooth font in every single control (treeviews, listviews, buttons, tabs, labels... just everything) but Qt still sticks to the old clumsy font.

    How to avoid this behavior or is there any workaround?
    Is this even a bug, because Qt seems to display QMenu and QMessageBox (but not QDialog) with the right font but the rest is just the old aliased font?

    Thank you guys in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt renders wrong font

    What happens if you change the default font in qtconfig to a one that should be antialiased?

  3. #3
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    84
    Thanks
    5
    Thanked 5 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt renders wrong font

    I guess I'm kinda blind or something... but I just can't find the qtconfig tool anywhere I even did a search for it but nothing came up? All I found was the proper qtconfig html-file from the documentation...

  4. #4
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    84
    Thanks
    5
    Thanked 5 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt renders wrong font

    Anyways, I just looked up the font that is being used by the Windows Theme and its size and I put this in my main-function:

    Qt Code:
    1. QFont font("Segoe UI");
    2. font.setPixelSize(11);
    3. QApplication::setFont(font);
    To copy to clipboard, switch view to plain text mode 

    Now everything looks just like it supposed to in my application, but that can't be the solution

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt renders wrong font

    Maybe Windows version doesn't have qtconfig, I don't know. The actual problem is that the default font of your Qt installation is set to a font which is fine for one theme but is not updated when you switch teams. It might even be a limitation of Qt itself, you might want to report a suggestion to the Trolls to make it possible to switch default fonts automatically to comply to the theme used.

  6. #6
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    84
    Thanks
    5
    Thanked 5 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt renders wrong font

    I created a new task at trolltech.com
    Let's see if anything changes. But I definitely think this is a bug

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt renders wrong font

    I don't think it is a bug. Maybe a lack of feature but not a bug. You can always subclass QApplication and set the font yourself based on what your system settings are.

  8. #8
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    84
    Thanks
    5
    Thanked 5 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt renders wrong font

    The trolls added my task to their task tracker:

    Task ID: 136762

    So, what happens now? Do I have to look at that task entry a few times for a couple of weeks or does anything happen in general at all?

  9. #9
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Qt renders wrong font

    Do you mean like if there's any further actions required by you? No. The time it takes to fix the bug of course depends on how urgent the bug is considered by the Trolls.
    Last edited by jpn; 2nd November 2006 at 17:45. Reason: spelling error
    J-P Nurmi

Similar Threads

  1. couldn't open fontconfigs chosen font with Xft!!!
    By Kenneth Freidank in forum Qt Programming
    Replies: 0
    Last Post: 5th October 2006, 04:14
  2. Replies: 1
    Last Post: 8th May 2006, 08:07
  3. how to use user define font
    By numen in forum Qt Programming
    Replies: 1
    Last Post: 20th April 2006, 11:25
  4. Why QStyle dosen't changes the standard font?
    By Dark_Tower in forum Newbie
    Replies: 8
    Last Post: 31st March 2006, 03:49
  5. Determine system font
    By niala in forum Qt Programming
    Replies: 2
    Last Post: 21st March 2006, 23:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.