Results 1 to 3 of 3

Thread: Font in simulator and S60 device don't look the same

  1. #1
    Join Date
    Jul 2010
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Font in simulator and S60 device don't look the same

    Hi everyone,

    I have an issue which I am not able to overcome. It's about fonts in Qt simulator and S60 device.

    What I'm doing is drawing a text on a QPainter with drawText method. I set fonts with setFont method and I specify Series 60 Sans font. The code looks something like this:

    Qt Code:
    1. void MyElement::paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget ) {
    2. painter->setFont( QFont( "Series 60 Sans", 36, QFont::Bold ) );
    3. painter->drawText( 0,0, "Dear John" );
    4. }
    To copy to clipboard, switch view to plain text mode 

    The thing is that what I see in Qt Simulator is completely different than what I see on device. What I can notice is that fonts have completely different sizes, different ascend, descend ...

    I assume fonts are not the same, at least I am leaning in that direction.
    I'm using N96 mini to test on S60 device with fonts installed on it,
    and I installed fonts on my PC, font version on PC is: Series 60 Sans Regular (TrueType). version 4.04, Monotype.

    Is this behavior normal or at least expectable? Or what am I doing wrong?
    If fonts are incorrect, where can I get correct ones? I tried S60 SDKs nothing helps. And if it is important, I'm using Windows XP SP2 and Nokia Qt SDK 1.0.

    Any help would be appritiated, otherwise it's time to visit mental institution.

  2. #2
    Join Date
    Jan 2010
    Posts
    18
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Font in simulator and S60 device don't look the same

    As far as the size and shape of fonts (what characters look like on desktop vs target), I've noticed that it helps to set the QWS_DISPLAY variable. Now with that said, I'm not familiar with the S60 environment. I run on an embedded linux platform and we have a run script that exports serveral Qt variables, before we "call" the executable. This is how we set the QWS_DISPLAY variable:

    export QWS_DISPLAY="LinuxFb:/dev/fb4:mmWidth=95:mmHeight=53.8"

    the mmWidth and mmHeight variables are what makes the difference for us. If you look in the vendor's documentation of your display, they may give you the PHYSICAL dimensions and the ACTIVE dimensions. Try the ACTIVE dimensions. Hope this helps.

  3. #3
    Join Date
    Jul 2010
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Re: Font in simulator and S60 device don't look the same

    After hiting the wall with my head, for few hours, constantly...

    I read some other posts and I found next one:
    http://www.qtcentre.org/threads/2699...in-embedded-QT

    To summarize, it seems that point size on PC and pixel size of QFont on S60 are in 4:3 ratio.
    Modifying fonts in example below solves the problem:

    Qt Code:
    1. QFont font( "Series 60 Sans", 36, QFont::Normal );
    2. font.setPixelSize( font.pointSize()*4/3 );
    To copy to clipboard, switch view to plain text mode 

    Thank you plambert

Similar Threads

  1. Compile on simulator but not on Symbian
    By curreli in forum Qt Programming
    Replies: 2
    Last Post: 13th August 2010, 09:18
  2. GPS in Simulator
    By Guilo in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 7th July 2010, 11:34
  3. Font problem in Qt embedded 4.4.3 on Arm device
    By rahman.duran in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 16th April 2009, 00:30
  4. installing the Packages in remote machine Simulator
    By Yeshwin in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 21st February 2009, 15:06
  5. Replies: 1
    Last Post: 1st February 2008, 18:55

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.