Results 1 to 5 of 5

Thread: Need Help to add new Font to QT

  1. #1
    Join Date
    Aug 2009
    Posts
    3
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Need Help to add new Font to QT

    Hi All,

    I am newbie to QT Embedded. I am using qt-embedded-linux-opensource-src-4.5.2.
    I want to add new font to the directory ~/qt-embedded-linux-opensource-src-4.5.2/lib/fonts so that I can reuse the font in all my applications. I have a custom_font.ttf file.
    I have copied that file to the above mentioned directory, but I am unable to use that font. Please tell me how to use this font.

    One more thing, can someone please tell me the procedure to convert a ttf or bdf file to qpf in Qt-Embedded-4.5.2 using the makeqpf tool. I have given the command like this
    makeqpf Giri 18
    ***Giri is the Font name and 18 is the pixel size.
    A qpf2 file with filename Giri_180_50.qpf2 will be generated in /binafter the above command is executed.

    Can someone tell me how to use the above .qpf2 file after it is generated.

    One more thing, there is no FontDir file under /lib/fonts folder in Qt-embedded-linux-opensource-src-4.5.2.

    Regards,
    Giri

  2. #2
    Join Date
    Nov 2008
    Location
    Oslo, Norway
    Posts
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: Need Help to add new Font to QT

    If you want to add new fonts they need to be in the lib/fonts folder of your Prefix, so unless your prefix is your source directory then what you are doing currently is not going to work. Also you can set your QT_QWS_FONTDIR environmental variable to to the location your fonts are at.

    To use makeqpf, you need to build it with your X11 version of Qt. its in the tools directory of the X11 qt source and it will provide a GUI for converting fonts to qpf's.

    Then place those .qpf files in the directory pointed to by your QT_QWS_FONTDIR env variable.

  3. The following user says thank you to nezticle for this useful post:

    giriprasad (1st September 2009)

  4. #3
    Join Date
    Aug 2009
    Posts
    3
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Need Help to add new Font to QT

    Hi Nezticle,

    Thanks for your useful information..I have followed your procedure and successfully integrated the fonts.

    Regards,
    giri prasad

  5. #4
    Join Date
    Jul 2009
    Posts
    26
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: Need Help to add new Font to QT

    Hello,

    I have a question connected to the topic. I want to compile qpf font from ttf one. Is it possible to do it without embedded version of qt? I'm on linux ubuntu karmic and could find makeqpf program in repositories. Having a folder lib/fonts, with fonts there and fontdir file, I can see that these fonts are seen by makeqpf - when I simply call makeqpf, the gui window opens and lists fonts. However calling makeqpf -A (all fonts to be qpf-ed), nothing happens.

    Please, I'm in great need to know that. Thank You for a response. Bye.

  6. #5
    Join Date
    Aug 2010
    Posts
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Question Re: Need Help to add new Font to QT

    Hello,

    My issues is not completely related to the topic but somewhat related.

    I am on linux and successfully added fonts using addApplicationFonts().
    I am invoking assistant from qt application(qt 4.5.3) but assistant is not using the same fonts which I set for my application. How do I force assistant to use the same fonts which I setfor my application?

    Thanks

Similar Threads

  1. Showing font symbols
    By drhex in forum Qt Programming
    Replies: 0
    Last Post: 4th March 2009, 21:53
  2. font can not be changed
    By ashishsaryar in forum Qt Programming
    Replies: 4
    Last Post: 28th May 2008, 15:32
  3. Automatic font selection
    By NTwoO in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 27th April 2007, 12:40
  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.