Results 1 to 11 of 11

Thread: How to make font Smooth in QT?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2011
    Posts
    25
    Qt products
    Qt4
    Platforms
    Windows

    Question How to make font Smooth in QT?

    Hello All,

    I have a simple question, or more something i need to understand i think...

    I designed a application in Photoshop and though font would look simular in qt, but it doesn't ofcourse.. after some time googling i learned photoshop uses some soort of smoothing the fonts. I found this is also possible in qt or at least i found something but it wasn't really clear to me still.

    In the attachment you can see the difference. In the left image you see the Photoshop text and on the right you see the same font and size in qt
    SEE HERE:
    how to make text smooth in qt.png

    Is it possible i make the font more smooth, so it could look simular like the Photoshop version?

  2. #2
    Join Date
    Oct 2010
    Posts
    55
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    1
    Thanked 11 Times in 10 Posts
    Wiki edits
    9

    Default Re: How to make font Smooth in QT?

    What platform are you targeting? I have been asking myself the same question and find this problem especially prevelant when rendering fonts in smaller sizes on MS Windows.

    So I just started to create some Qt-styled wrapper classes for the FreeType library. FreeType (www.freetype.org) is a font engine capable of rendering high-quality font output. It provides a low-level C API and is already used in a number of projects, but I wanted something that works without too much effort together with Qt's Painter framework.

    Currently I have something like:

    QFreeTypeEngine
    QFreeTypeFont
    QFreeTypeGlyph

    ...where a QFreeTypeEngine is responsible for creating and managing QFreeTypeFont objects for a specific application, and individual QFreeTypeFonts can be created from a font in the local filesystem, or from a resource.

    In attached screenshot you can see the difference between FreeType (above), and Windows' default font rendering algorithm (below).

    (Actually I'm not sure it's the exact same font face in both examples, but you can still see the difference in quality, especially if you open the image in PS and zoom in and look at the anti-aliasing.)

    ftype.jpg

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

    Default Re: How to make font Smooth in QT?

    Quote Originally Posted by helloworld View Post
    So I just started to create some Qt-styled wrapper classes for the FreeType library. FreeType (www.freetype.org) is a font engine capable of rendering high-quality font output. It provides a low-level C API and is already used in a number of projects, but I wanted something that works without too much effort together with Qt's Painter framework.
    I guess you are not aware Qt already uses FreeType...

    I'm not really sure what you guys are doing but font rendering in Qt is done using platform means and sometimes poor quality of fonts is caused by wrong settings of libraries responsible for font management/rendering, like FreeType, FontConfig or ClearType. Fonts in Qt apps and fonts on images in Photoshop are almost bound to look different as Photoshop provides a more fine-grained control over the rendering compared to what the system offers for applications. You can write the same text in Photoshop and on your window title bar and they will also look different.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Font Height and width based on font size
    By Ghufran in forum Qt Programming
    Replies: 1
    Last Post: 31st July 2010, 08:02
  2. Get a smooth curve
    By beekeep in forum Qwt
    Replies: 2
    Last Post: 7th January 2010, 17:49
  3. Change Font of QListWidget to Monospace Font
    By pospiech in forum Qt Programming
    Replies: 3
    Last Post: 25th July 2008, 18:23
  4. font incorrectly show - font break.
    By sgh in forum Qt Programming
    Replies: 9
    Last Post: 30th May 2008, 02:35
  5. setMask (smooth)
    By pakulo in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2007, 08:51

Tags for this Thread

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.