Results 1 to 2 of 2

Thread: QT4.6.3 to QT4.7.3 Font problem (Chinese)

  1. #1
    Join Date
    Jun 2008
    Posts
    64
    Thanks
    7
    Qt products
    Qt3 Qt4

    Default QT4.6.3 to QT4.7.3 Font problem (Chinese)

    I am having a simple QT4.6.3 program which may change language (toggle english<==> chinese)

    Qt Code:
    1. QFont f = QFont( "Luxi Sans", 11 );
    2. try
    3. {
    4. qApp->setFont( f );
    5. app.setFont(f);
    6. }
    7. catch(exception e)
    8. {
    9. Logger logger;
    10. logger.error("main.cpp","main()","qApp - set Font: Unknown exception" );
    11. }
    To copy to clipboard, switch view to plain text mode 

    No exception was caught in the log.

    After porting to QT4.7.3, I found that the Chinese font changed, like bold or set to a bigger size. I would like to know if there's any change between QT4.6 and 4.7 that leads to this problem?And, how should I correct this? I've tried setting a smaller font size and it's not working.

    Thanks!

  2. #2
    Join Date
    Nov 2010
    Posts
    315
    Thanked 53 Times in 51 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QT4.6.3 to QT4.7.3 Font problem (Chinese)

    First check if Luxi Sans font supports Chinese glyphs.
    Qt tries to use different font if some characters are not supported by given font (I heard it is called font fall back system).
    It is possible that they change/improved how missing characters are resolved (by which font) and this is why you see a different fonts in those Qt versions.
    IMHO it is better to use font which supports required characters/symbols.
    If you like one font in English localization and another font in Chinese localization then set font in code using translatable string as a font name, so you will provide different font name for each translation.

Similar Threads

  1. Problem with chinese and japanese characters display
    By manojmka in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 26th February 2010, 06:09
  2. Replies: 1
    Last Post: 15th May 2009, 08:16
  3. I have a problem ,how to get chinese unicode ?
    By tsuibin in forum Qt Programming
    Replies: 5
    Last Post: 8th April 2009, 10:26
  4. problem with show Chinese
    By osmanthus in forum Qt Programming
    Replies: 1
    Last Post: 20th January 2009, 03:49
  5. Loading chinese font for the application
    By kommu in forum Qt Programming
    Replies: 1
    Last Post: 13th June 2008, 15:12

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.