[Interest] Glyph fallback

Ender Erel ender.erel at icterra.com
Fri Nov 22 09:35:12 CET 2013


Hi All,

I think my approach was wrong the whole time, so let me try again.

I am working on QtEmbedded 4.1.4. I have three fonts: FontA contains Latin, FontB contains Korean, FontC contains Chinese characters and each font is from a different family. I also have three labels in my app (LabelA, LabelB, LabelC), each containing text in each language respectively. What i want to achieve is: Render all labels successfully, without setting fonts per language explicitly on the labels.

We are using the legacy fontdir file approach mentioned in the following page:
http://qt-project.org/doc/qt-4.8/qt-embedded-fonts.html

When i check the QFontDatabase, all three fonts are found.

Now, here is my problem: When i use QApplication::setFont("FontA"), only the text in LabelA is visible (same for FontB-LabelB and FontC-LabelC). I use QFont::AnyStyle & QFont::PreferDefault as style hint&strategy. So I thought Qt would take the characters from the other fonts, but it doesn't.

I was told that fontconfig was the way to go, but as mentioned on this page, fontconfig is not supported on QtEmbeeded, therefore i gave up on that.
http://qt-project.org/doc/qt-5.0/qtdoc/qt-embedded-fonts.html

Then i saw the following page:
http://stackoverflow.com/questions/14125081/how-to-properly-output-multilingual-text-in-qt-embedded
...and tried the "QSWS_NO_SHARE_FONTS=1" fix, but that didn't solve my problem either. The poster says he's got multiple fonts from the same family, and he successfully uses them at the same time without explicitly setting them per-widget, so why can't i do it? The only difference i can think of is the family issue, (his fonts are the same family, mine aren't).

I can't figure out why Qt can't render text in different languages without explicitly setting the font per widget, like it does in the CharacterMap example with "Font Merging" checked.

Any help is much appreciated.

Best Regards,
Ender
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131122/3d24d2f5/attachment.html>


More information about the Interest mailing list