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. Not displaying Chinese characters
Forum Updated to NodeBB v4.3 + New Features

Not displaying Chinese characters

Scheduled Pinned Locked Moved Solved Mobile and Embedded
19 Posts 3 Posters 6.4k 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.
  • V Offline
    V Offline
    vdevadass
    wrote on last edited by
    #8

    Hi
    Update: if i set the font manually, i can see chinese but if i add it using addApplicationFont(), Qt does not pick it up. I want the application to support mulitple language in different font families automatically, any way to do this? And does this have something to do with fontconfig??

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

      What do you mean by "set the font manually" ?

      How would your application support multiple languages ?

      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
      • V Offline
        V Offline
        vdevadass
        wrote on last edited by vdevadass
        #10

        Hi, sorry for the late reply.
        i set NanumGothic as default font using setFont(). Hence, I think maybe my embedded qt doesnt know NanumGothic is present.

        i have another question, i copied the ttf files to the embedded devices, is that the proper way or is there way to install the font in the embedded device? ( i don't know what installing a font means, i saw it across the web, if you can explain it would be helpful)

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

          Did you check the return values of your font setup code ?

          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
          • V Offline
            V Offline
            vdevadass
            wrote on last edited by
            #12

            The application chooses DejaVuSans.

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

              Hence my question, did you check the return value of addApplicationFont ?

              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
              • V Offline
                V Offline
                vdevadass
                wrote on last edited by
                #14

                The return of addApplicationFont() is 0 for /usr/lib/fonts/NanumGothic.ttf

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

                  And how are you selecting and setting that font in your application ?

                  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
                  • V Offline
                    V Offline
                    vdevadass
                    wrote on last edited by
                    #16

                    QFont font("/usr/lib/fonts/NanumGothic.ttf");
                    font.setPointSize(FONT_SIZE);
                    font.setBold(true);
                    QApplication::setFont(font);

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

                      QFont doesn't have any constructor that takes a file path.

                      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
                      2
                      • V Offline
                        V Offline
                        vdevadass
                        wrote on last edited by
                        #18

                        Hi,

                        The chinese characters are being displayed on the target, but i didn't change my code, this has me stumped, unable to figure out why it is being displayed out of the blue?!
                        Anyway thank you SGaist for all your help :) I will close this thread for now

                        1 Reply Last reply
                        0
                        • V Offline
                          V Offline
                          vdevadass
                          wrote on last edited by
                          #19

                          Update, it seems that the fontconfig was choosing NanumBrush and NanumPen over NanumGothic, hence i was unable to see the Chinese characters previously.

                          1 Reply Last reply
                          1

                          • Login

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