Results 1 to 8 of 8

Thread: Drawing Text

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2008
    Posts
    139
    Thanks
    9
    Thanked 18 Times in 15 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Drawing Text

    thanks for the advice.
    I am using "Times" or "Helvetica". The leading value is always 0 or in some cases -1, it's the linespacing that changes. I thought I would include this if it gives you another idea.

    For example
    Times @ font size 15, line spacing = 17
    Times @ font size 16, line spacing = 23
    Helvetica @ font size 17, line spacing = 23
    Helvetica @ font size 16, line spacing = 22

    edit: I guess using BoundingRect will be difficult if I am word wrapping..?
    sorry, edit again.. I tried BoundingRect, seems ok regarding the wordwrapping.. still don't like the linespacing.
    Attached Images Attached Images
    Last edited by QbelcorT; 7th March 2009 at 09:52.

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

    Default Re: Drawing Text

    Line spacing = leading + height. Note that "height" is not the point size of the font but rather ascent+descent+1.
    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. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Replies: 2
    Last Post: 23rd July 2012, 08:42
  3. Drawing Rich Formatted Text with QPainter
    By millsks in forum Qt Programming
    Replies: 1
    Last Post: 5th March 2009, 19:59
  4. Problems with QString
    By cyberboy in forum Qt Programming
    Replies: 2
    Last Post: 13th October 2008, 08:18
  5. Drawing antialiased text on Windows very slow
    By Rawk in forum Qt Programming
    Replies: 13
    Last Post: 14th May 2007, 14:13

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.