Qt Embedded, mixing unicode characters makes code lagging.



  • I am using Qt Embedded 4.8 and in my application I have a QListWidget containing a number of QListWidgetItems displaying some mixed unicode characters.

    If I only use mixed Latin and CJK unicode characters, in my QListWidgetItems, the text is displayed as expected and scrolling between QListWidgetItems works without lagging.

    My QFontDatabase reports the following fonts installed:

    Bitstream Charter
    Code2000
    Courier
    Courier 10 Pitch
    Cursor
    fixed
    helvetica
    Luxi Mono
    Luxi Sans
    Luxi Serif
    micro
    Roboto
    RockoFLF
    Times New Roman
    unifont
    Utopia
    WenQuanYi Zen Hei
    WenQuanYi Zen Hei Mono
    WenQuanYi Zen Hei Sharp
    

    N.B. I will remove all fonts beside Roboto, RockoFLF and Code2000, since they are the only ones I am aiming to use.

    Now I am trying to get support for Thai and Tamil characters. If I just add Thai and Tamil characters to my texts they will not display.

    Thai and Tamil characters are not displayed

    Adding Thai and Tamil characters to the texts will make the application load slowly and and scrolling between QListWidgetItems is lagging and is sluggish.

    The only way I have found for the Tahi and Tamil characters to be displayed is to add a font in my qtss-file (gui.qtss). I have added that QListWidget and QListWidgetItems should use "Code2000" as font.

    QListWidget      { font: 13px "Code2000"; }
    QListWidget:item { font: 13px "Code2000"; }
    

    I have also tried to use a <code>font-family</code>, since I would like for Latin characters to use "Roboto" as font.

    QListWidget      { font: 13px; font-family: "Roboto", "Code2000"; }
    QListWidget:item { font: 13px; font-family: "Roboto", "Code2000"; }
    

    Thai and Tamil characters are displayed

    Either way the application still loads slowly and and scrolling between QListWidgetItems is still lagging and is sluggish.

    What I need help with is to find a way for Qt to use fonts, and displaying Thai and Tamil characters, without having to add fonts in the qtss-file. I also is wondering why the code gets sluggish when mixing in Thai and Tamil characters. Mixing Latin and CJK characters works just fine

    I have been studing the following two wonderful posts:

    Qt Use Multiple Fonts at the Same Time

    How to (properly) output multilingual text in Qt-Embedded?

    But none of the methods, in those posts, have been working for me. I have yet to try fontconfig. I am not sure what fontconfig will do for me.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What version of Qt 4.8 are you currently using ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.