Results 1 to 6 of 6

Thread: broken font in qt windows

  1. #1
    Join Date
    Mar 2013
    Location
    Hyderabad,Bangalore,India
    Posts
    70
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default broken font in qt windows

    Hi,
    I am facing a strange problem of font display in Qt application windows.

    I have installed Qt 4.8.0 in Ubuntu 11.10. when the run the examples given the font of windows is not clear and it is kind of broken.
    please see the attached image.

    please let me know how to solve the problem.



    thanks.
    Attached Images Attached Images

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: broken font in qt windows

    The example you have does not specify particular font: it just uses the default for the style/platform. Your system is providing a poor substitute for the font requested. This should more-or-less affect all the Qt examples. Install the font being used, probably a basic Truetype sans serif font, or substitute a font with Unicode support.

  3. #3
    Join Date
    Mar 2013
    Location
    Hyderabad,Bangalore,India
    Posts
    70
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: broken font in qt windows

    I have executed other examples also, in all the cases the font is not clear, even the application created by me also does not display proper font.

    How can i make Qt takes other fonts?
    and if system does not have all fonts or need to change the default font for Qt how to do install it?

    i have tried installing below
    sudo apt-get install msttcorefonts
    gnome-panel and gnome-tweak-tool

    but did not help.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: broken font in qt windows

    The default font used by Qt on Linux appears to be whatever fontconfig matches for "sans serif".
    What does:
    Qt Code:
    1. $ fc-match 'sans serif'
    To copy to clipboard, switch view to plain text mode 
    list on your machine? It's a "DejaVu Sans" on my machine but might be different in your case.

    You can see the the default font setting in:
    Qt Code:
    1. $ qtconfig
    To copy to clipboard, switch view to plain text mode 
    however your mileage may vary if your change the font. Some styles do not seem to take note of the setting.

  5. #5
    Join Date
    Mar 2013
    Location
    Hyderabad,Bangalore,India
    Posts
    70
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: broken font in qt windows

    It list the same as yours "DejaVu Sans" for me.
    I have tried to modify using qtconfig, but did not help , the effect is same.

    I have gone through below links actually

    https://bbs.archlinux.org/viewtopic.php?id=166034
    https://bbs.archlinux.org/viewtopic.php?id=69336
    https://bbs.archlinux.org/viewtopic.php?id=67031

    they are saying it has something to do with sub-pixel rendering , but they dint mention where to make changes and how.
    do you have any idea?

  6. #6
    Join Date
    Oct 2015
    Posts
    5
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: broken font in qt windows

    I am facing the same issue.
    I am using Qt 4.8.7 in Ubuntu 14.04. I have tried gnome-tweak-tool but nothing seems to be reflected in qt application. Fonts are still broken.

Similar Threads

  1. Replies: 1
    Last Post: 30th March 2012, 16:46
  2. Unreadable font in QT4.7.1 (Windows)
    By i3th in forum Qt Programming
    Replies: 2
    Last Post: 11th March 2011, 15:00
  3. Replies: 1
    Last Post: 25th December 2007, 10:35
  4. Font Problem Porting from Windows to Linux
    By rajeshs in forum Qt Programming
    Replies: 1
    Last Post: 13th July 2007, 10:25
  5. Broken QFileSystemWatcher in Qt 4.2.3 under Windows?
    By No-Nonsense in forum Qt Programming
    Replies: 4
    Last Post: 28th March 2007, 14:14

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
  •  
Qt is a trademark of The Qt Company.