Results 1 to 4 of 4

Thread: Font Selection Advice for GUI Linux supporting different resolutions.

  1. #1
    Join Date
    Mar 2007
    Posts
    59
    Thanks
    7

    Default Font Selection Advice for GUI Linux supporting different resolutions.

    I have an application that looks perfect on my development system, which is a laptop with screen resolution of 1024x768, running ubuntu 8.04. If i run my application on a system with the same resolution it looks fine

    When i run it on a system with something like 1600x1200 resolution again ubuntu 8.04, the fonts look MASSIVE, way too large.

    I felt this was a font selection issue, so i made sure i selected a font that would be on most systems "Helvetica". I since have seen that the proper font is being chosen, although it obviously doesnt look like it.

    in main.cpp i have this to check.

    Qt Code:
    1. QFont font( "Helvetica", 10 );
    2. app.setFont( font );
    3.  
    4. QFontInfo info(font);
    5. QString family = info.family();
    6. qDebug() << "FONT:" << family;
    7. qDebug( "Font size requested is : %d", font.pointSize() );
    8. qDebug( "Font size actually used is: %d", info.pointSize() );
    To copy to clipboard, switch view to plain text mode 

    On my development system i get this in the console:
    FONT: "Helvetica"
    Font size requested is : 10
    Font size actually used is: 11

    on the other system (the one with the 1600x1200 screen resolution) I get this:
    FONT: "Helvetica"
    Font size requested is : 10
    Font size actually used is: 9

    So they should both be comparable, but they are not.

    Any advice is appreciated, thanks

    QT version 4.4.1
    Attached Images Attached Images
    Last edited by nbkhwjm; 19th December 2008 at 06:09. Reason: addt qt version

  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: Font Selection Advice for GUI Linux supporting different resolutions.

    It is best not to select any font at all and let Qt use the default font (at least the font size). The effect you are getting seems to be caused by not applying layouts to your widgets.

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

    nbkhwjm (19th December 2008)

  4. #3
    Join Date
    Mar 2007
    Posts
    59
    Thanks
    7

    Default Re: Font Selection Advice for GUI Linux supporting different resolutions.

    not attempting to define the font does give better results, but it still isnt very pretty.

    How do i go about setting BOLD and such, stylesheets instead of the designer "font" parameter?

  5. #4
    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: Font Selection Advice for GUI Linux supporting different resolutions.

    You can set the bold parameter of the font. Just don't set the family. And please apply layouts to your widgets.

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.