Results 1 to 2 of 2

Thread: scale qpainterfont / qfontmetricsf

  1. #1
    Join Date
    May 2012
    Posts
    57
    Thanks
    11
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default scale qpainterfont / qfontmetricsf

    Hello,

    I'm working on an app for android with qt and I'm having problems with the font size of qpainter. On my tablet the fontsize is allright but on my phone it's too large. They both have the same resolution but the phone has ~252 ppi and the tablet about half that.
    I have looked at qfontmetricsf but I don't understand how I can calculate and set the right fontsize with it.

    Thank you.

  2. #2
    Join Date
    May 2012
    Posts
    57
    Thanks
    11
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: scale qpainterfont / qfontmetricsf

    Nevermind, I found QPaintDevice::logicalDpiX which does the trick.

Similar Threads

  1. qwt Scale
    By David812 in forum Qwt
    Replies: 3
    Last Post: 24th May 2011, 08:43
  2. How to scale pixmap to fit
    By Splatify in forum Newbie
    Replies: 5
    Last Post: 21st April 2011, 16:45
  3. Marker and Scale
    By WXNSNW in forum Qt Programming
    Replies: 0
    Last Post: 11th December 2008, 09:44
  4. Only integers from QFontMetricsF width
    By StevenB in forum Qt Programming
    Replies: 3
    Last Post: 16th May 2008, 21:59
  5. qwt 5 log scale..
    By halberdier83 in forum Qwt
    Replies: 7
    Last Post: 12th November 2007, 07:21

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.