Results 1 to 2 of 2

Thread: Font sizes

  1. #1
    Join Date
    Jun 2007
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Font sizes

    I'm a bit confused about how font sizes work in Qt, particularly in GraphicsView.
    From what I understand, a 72 point font should appear 1 inch tall on the screen, and print out 1 inch high. This is resolution independent, meaning that Qt will adjust the pixel height of a font in order to keep it the same size on the screen.

    If I paint a 72 point font onto a QGraphicsItem which is added to a QGraphicsScene, how many scene units tall will it be (assuming I haven't done any scaling)? If I display the scene with QGraphicsView, will the font still be displayed in a resolution independent way?
    Is there a document somewhere that explains all of the fine details of how this all works?

  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: Font sizes

    Quote Originally Posted by StevenB View Post
    From what I understand, a 72 point font should appear 1 inch tall on the screen, and print out 1 inch high. This is resolution independent, meaning that Qt will adjust the pixel height of a font in order to keep it the same size on the screen.
    Hmm... I thought this is how pixelSize worked.

    If I paint a 72 point font onto a QGraphicsItem which is added to a QGraphicsScene, how many scene units tall will it be (assuming I haven't done any scaling)? If I display the scene with QGraphicsView, will the font still be displayed in a resolution independent way?
    You are using some resolution so at some point in time even a resolution independent size will become physical. About scene units - it depends, if you didn't do any transformations then one logical point corresponds to one device (screen in this case) point.

Similar Threads

  1. Font size calculation when painting in a QImage
    By Ishark in forum Qt Programming
    Replies: 3
    Last Post: 15th July 2007, 22:22
  2. Automatic font selection
    By NTwoO in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 27th April 2007, 12:40
  3. qt-config and font sizes
    By hvengel in forum Qt Programming
    Replies: 2
    Last Post: 10th April 2007, 00:31
  4. Font not Antialiasing
    By ChasW in forum Qt Programming
    Replies: 6
    Last Post: 21st January 2007, 18:12
  5. Qt renders wrong font
    By durbrak in forum Qt Programming
    Replies: 8
    Last Post: 2nd November 2006, 14:36

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.