Results 1 to 2 of 2

Thread: how to use user define font

  1. #1
    Join Date
    Apr 2006
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default how to use user define font

    i have a font ,it's truetype but it doesn't work
    the following is the example
    QString str;
    str.sprintf("%d,%d",p->width(),p->height());
    QFont f("8888 8888",15);//8888 8888 is font name
    painter.setFont(f);
    painter.drawText(200,200,str);
    but it doesn't display my font ,why?
    can anyone tell me how to use a font that isnot system font.

  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: how to use user define font

    Does your font system know about that font? Which platform do you use? Does QFontDatabase know your font?

Similar Threads

  1. Logging Qt User Actions
    By Frank J. Lhota in forum Qt Programming
    Replies: 14
    Last Post: 30th May 2014, 21:36
  2. odd double widgets
    By jhearon in forum Qt Programming
    Replies: 1
    Last Post: 23rd February 2008, 18:18
  3. Font size calculation when painting in a QImage
    By Ishark in forum Qt Programming
    Replies: 3
    Last Post: 15th July 2007, 22:22
  4. Macro used for debugging
    By sunil.thaha in forum General Programming
    Replies: 11
    Last Post: 30th March 2007, 17:32
  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.