[Solved] Arm Linux Qt5.3.2 checklist to support simplified chinese?



  • When I debug my app under Ubuntu it displays Chinese characters OK. However under Arm/Linux it displays empty boxes. I conditionally load a simplified Chinese ttf or DejaVu Serif, depending on a setting.

    1. I have a set of ttf's for DejaVu but a single file for SimpChinese.ttf (really DFSong1B-GB).
    2. I have none nothing for the locale, etc.
    3. If I knew what else to try I'd be better off :)

    (SimpChinese.ttf (really DFSong1B-GB) was not loading proper unicode mapping...)


  • Lifetime Qt Champion

    Hi,

    Might be a silly question but did you check that the font is loaded successfully ?



  • @SGaist - I am just starting to implement and debug it. All I know is that I set FontFamily to the name (absent ttf file extension) and the font ttf file is in the same directory that does launch. It occurs to me that "DFSong1B-GB" is probably the font family despite my renaming the file.


  • Lifetime Qt Champion

    Are you using QFontDatabase ?



  • I am simply using QFont to load a font. The problem was that the font I installed on the device did not support Unicode, I guess. I put unifont on the device and it works.

    I am now down to legibility issues at the 10-12 pixel size allocations in the device. That is sufficient for Latin ASCII but not enough for Hanzi. I am looking for a better font face and balancing light/bold/etc. for readability.

    QFont fontBold;
    switch (HMI_settings.u16TextLang)
    {
    default:
        fontBold.setFamily((FontName)); //(QStringLiteral)
        break;
    
    case Lang_SimpChinese:
        break;
    }
    
    printf ("%s\n", FontName.toLatin1().constData());
    fontBold.setPixelSize(12*HMI_SCALE);
    fontBold.setBold(true);
    fontBold.setItalic(false);
    fontBold.setWeight(75);
    fontBold.setStyleStrategy(QFont::PreferAntialias);

Log in to reply
 

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