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));
-
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));
@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.
-
@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