Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How do I get non-latin characters to display?
Forum Updated to NodeBB v4.3 + New Features

How do I get non-latin characters to display?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
8 Posts 2 Posters 2.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gsmp42
    wrote on last edited by
    #1

    Hi All,
    I am attempting to display Chinese and Japanese characters on a Raspberry Pi without any luck.
    I am utilising Buildroot for the OS and QT 4.8.6.
    I have tried installing my own font with QFontDatabase::addApplicationFont using a simsun file added to the resources.
    I have tried with both FreeType on and off.
    All I am attempting to do at this stage is to draw a QLabel with Chinese characters in it.

    The same program on Ubuntu and on Windows, the characters that there just fine so I am pretty sure it is a font issue but I can't find any help on the internet that describes exactly what one needs to do to get non-latin characters to display.
    Anyone here able to help - I would be most appreciative as I have been at this for four days now with zero progress !

    Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Did you check that the font was added properly to QFontDatabase ?
      Also, did you set it on the label where you want to show these Chinese characters ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Gsmp42
        wrote on last edited by
        #3

        @SGaist , Thanks for taking the time to reply.
        On the target, I have set it to display QFontDataBase::families() and on the screen and I see the following displayed:
        BitStream Vera Sans, BitStream Vera Sans Mono, BitStream Vera Serif, DejaVu Sans, DejaVu Sans Mono, DejaVu Serif, fixed, helvetica, japanese, micro and unifont. So from that I conclude that the fonts are in the system and should be accessible.

        On a form I set one QLabel and put in Chinese characters and a second QLabel and put in Japanese characters.
        In code I include the following:
        QFont newFont;
        newFont.setFamily("Deja Vu Sans");
        ui->label_Chinese->setFont(newFont);
        newFont.setFamily("japanese");
        ui->label_Japanese->setFont(newFont);

        On PC and Ubuntu the characters display perfectly but on embedded they are blank.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Are you using the same version of Qt on both your desktop and target ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          G 1 Reply Last reply
          0
          • SGaistS SGaist

            Are you using the same version of Qt on both your desktop and target ?

            G Offline
            G Offline
            Gsmp42
            wrote on last edited by
            #5

            4.8.5 on Ubuntu and Embedded.
            4.8.6 on PC

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              You really should use the same version everywhere. Also, if possible you should update to 4.8.7 which is the latest and also version of the Qt 4 series.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              G 1 Reply Last reply
              0
              • SGaistS SGaist

                You really should use the same version everywhere. Also, if possible you should update to 4.8.7 which is the latest and also version of the Qt 4 series.

                G Offline
                G Offline
                Gsmp42
                wrote on last edited by
                #7

                Yes I agree, but I don't think that is the root of the problem.
                I have inherited this project so I am trying not to change too many things at once until I get this issue sorted out.
                A slight typo in my previouis post - the Ubuntu installatiion is 4.8.5 and the embedded and PC are 4.8.6
                Any further suggestions would be much appreciated.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  You should verify on your target that you are getting what you asked for i.e. that the font is really what you asked.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved