Results 1 to 4 of 4

Thread: Cross platform font issue.

  1. #1
    Join Date
    Nov 2008
    Posts
    39
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Cross platform font issue.

    Presently we are developing a cross platform application using Qt and the requirements are to maintain font sizes same on mac and windows. In windows the font looks good but on mac the fonts are very small.

    How to manage cross platform fonts sizes?

    Fonts used are ttfs.

    Thanks & regards,
    Mohan.

  2. #2
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Cool Re: Cross platform font issue.

    Use the Qt macros like shown below
    Qt Code:
    1. #ifdef Q_OS_WIN32
    2. //windows font size
    3. #elif Q_OS_MAC
    4. //mac font size
    5. #endif
    To copy to clipboard, switch view to plain text mode 
    Heavy Metal Rules. For those about to rock, we salute you.
    HIT THANKS IF I HELPED.

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

    manmohan (16th April 2013)

  4. #3
    Join Date
    Nov 2008
    Posts
    39
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Cross platform font issue.

    How about the fonts that will be used through style sheets in qt designer.

  5. #4
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Cross platform font issue.

    How about the fonts that will be used through style sheets in qt designer.
    The font given in stylesheet, need to be available in ur target.

    Qt uses FreeType 2 font engine to produce font output
    http://doc.qt.io/qt-4.8/http://qt-project.org/doc/qt-5.0/qtdoc/qt-embedded-fonts.html

    hope it helps
    Bala

Similar Threads

  1. Cross-platform Windows & Mac: Font size problem
    By monkazer in forum Qt Programming
    Replies: 3
    Last Post: 25th July 2012, 16:10
  2. How to handle cross platform font sizes
    By Berryblue031 in forum Qt Programming
    Replies: 2
    Last Post: 27th June 2011, 15:55
  3. Replies: 1
    Last Post: 11th November 2010, 01:31
  4. Cross-platform GUI app
    By rockballad in forum Qt Programming
    Replies: 2
    Last Post: 21st April 2010, 08:38
  5. Cross platform development
    By muhQ in forum Newbie
    Replies: 2
    Last Post: 18th June 2008, 23:06

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.