Some unicode characters not displayed on UI



  • 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.



  • 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));
    


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



  • @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



  • @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.


Log in to reply
 

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