Qt World Summit: Register Today!

Android Japanese / DroidSansFallback Not Displaying Japanese Characters - Solved

  • I am working on an Android project on ARM.

    As far as I understand it the native way on Android to handle font families is by using xml configuration files to set priority. For example, in fallback_fonts.xml I would place the MTLmr3m.ttf (Japanese Fonts) above DroidSansFallback.ttf and the Japanese glyphs would be rendered from the Japanese font file.

    This is important because the DroidSansFallback.ttf file has traditional Chinese glyphs at the Japanese code points (the unicode code points for the two languages overlap).

    My current problem is that I cannot find a way to prioritize these fonts using QAndroidPlatformFontDatabase. It builds a fallback family but seems to look for the glyph first in DroidSansFallback.ttf and it will find the traditional chinese glyph there, so it will render that.

    Does anyone have any suggestions?

  • I ended up changing the QAndroidPlatformFontDatabase to load only one font: the NotoSans CJK Japanese otf font.

    Apparently the other languages fall back to the system's loaded fonts because all of the other language glyphs (Russian, Portuguese, Spanish, Chinese, Korean, etc.) are displayed properly.

    I'm not sure exactly why this works, but it works. I'm closing this topic.

Log in to reply