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. Some unicode characters not displayed on UI
QtWS25 Last Chance

Some unicode characters not displayed on UI

Scheduled Pinned Locked Moved Solved Mobile and Embedded
6 Posts 3 Posters 3.9k Views
  • 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
    #1

    Hi all,

    Working on Qt 4.8.
    Some unicode characters are not displayed on the target UI (embedded UI). Default font is DejaVuSans.

    Unicode characters not being displayed are as follows: "\u2399" "\u2386"

    When the same UI is run on ubuntu, the characters are displayed.

    I need some help in figuring out why this is happening.

    Is this a font library issue or something else i'm not sure?

    I tried using helvetica, most of the other characters that were appearing also disappeared.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi! You can check if the font on your device contains these characters with:

          QFont f("DejaVu sans");
          QFontMetrics fm(f);
          qDebug() << fm.inFont(QChar(2399)) << fm.inFont(QChar(2386));
      
      K 1 Reply Last reply
      2
      • V Offline
        V Offline
        vdevadass
        wrote on last edited by
        #3

        Thank you. The font file didnt have the unicode glyph.

        1 Reply Last reply
        0
        • ? A Former User

          Hi! You can check if the font on your device contains these characters with:

              QFont f("DejaVu sans");
              QFontMetrics fm(f);
              qDebug() << fm.inFont(QChar(2399)) << fm.inFont(QChar(2386));
          
          K Offline
          K Offline
          kumararajas
          wrote on last edited by kumararajas
          #4

          @Wieland said in Some unicode characters not displayed on UI:

          QFont f("DejaVu sans");
          QFontMetrics fm(f);
          qDebug() << fm.inFont(QChar(2399)) << fm.inFont(QChar(2386));
          

          This is nice! Is there any easy way to look for characters in the string can be displayed or not?
          For example,
          ā˜Ž Call me.
          String contains unicode character. Is there a direct way to see if this string can be displayed or not? Instead of going through the string and get each character and look if the device can display this?

          Addon question - Assuming that I can identify if this string and the answer is, I cannot display this unicode character (telephone) with the font is being used currently, can I set the font only for the specific unicode character?
          Example, Use 'Free Mono' for the telephone unicode character and use 'DejaVU Sans' for the rest of the string?

          Thank you!

          Kumara

          --Kumar

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            @kumararajas said in Some unicode characters not displayed on UI:

            For example,
            ā˜Ž Call me.
            String contains unicode character. Is there a direct way to see if this string can be displayed or not?

            No.

            can I set the font only for the specific unicode character?

            A QString has no font associated with it. So the question makes no sense.

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kumararajas
              wrote on last edited by kumararajas
              #6

              @Wieland said in Some unicode characters not displayed on UI:

              can I set the font only for the specific unicode character?

              I wasn't talking about QString. I was talking about the QWidget containing the text.
              I think I did want to mention that, can I use two fonts for QWidget, example, set text on QPushButton , which contains an unicode character and a latin characters. If the font set for that push button does not contain the unicode character, will Qt switch to a different font only for that unicode character and use the set font for rest of latin characters for rendering. Something similar to https://stackoverflow.com/questions/30100156/qt-embedded-multiple-font

              --Kumar

              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