Results 1 to 2 of 2

Thread: Logical fonts?

  1. #1
    Join Date
    Feb 2007
    Posts
    27
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Logical fonts?

    I've been playing around with Qt on the Mac and Windows, porting windows from our earlier non-Qt solutions. But I've been running into a "How do I do this?"-type problem.

    The problem I'm having is that Mac applications should use the standard system font. This is a larger system font than on Windows. A smaller version is available, for hint text, descriptions and such.

    So in Qt, I'm trying to lay out most of my windows using the default font (which is the system font). Where I need to add some hint text, I tried to use the smaller font size. When I took this over to Windows, I found my hint text was larger than the controls, because even the Mac small system font is larger than the Windows system font.

    What I'd like to do is use two different fonts on Mac, and the same font on Windows. Actually, you could probably extend this to three:

    System Large Bold (for titles, section headers)
    System Large (for most controls)
    System Small (for hint/explanation text)

    I'm at a loss on what approach to take on this. I define all my forms in Designer, and would like to continue to do so, but I don't especially care if Designer doesn't recognize these fonts, as long as I can work around it somehow.

    Style sheets looked interesting, but they seem to not be supported in Qt/Mac 4.2. Does anyone have any tips?

  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: Logical fonts?

    Under Linux Qt has font substitution capabilities that can be configured using qtconfig. I think the Windows edition doesn't have that tool, but it is possible one can still do such substitutions using the general Qt config file.

    It looks like so (a regular QSettings "ini" file):
    [Qt]
    Font%20Substitutions\A.D.%20MONO=
    Font%20Substitutions\MS%20Shell%20Dlg=arial
    Font%20Substitutions\arial=helvetica
    Font%20Substitutions\courier%20new=courier
    Font%20Substitutions\helv=helvetica
    Font%20Substitutions\sans%20serif=helvetica
    Font%20Substitutions\times%20new%20roman=times
    Font%20Substitutions\tms%20rmn=times

Similar Threads

  1. How to improve fonts in designer ?
    By probine in forum Qt Tools
    Replies: 3
    Last Post: 25th October 2006, 20:38
  2. Fonts, Colors, and QStyle
    By Jimmy2775 in forum Qt Programming
    Replies: 1
    Last Post: 28th September 2006, 07:26

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.