简体   繁体   中英

Some unicode characters dont render on some devices

I am using a button with the text set to 10\ˣ. This should show 10 and (superscript x) (10⁷) , but on some devices, it does not. I tested this on Nokia X, it shows. On galaxy S2, I don't get the superscript at all, I just get the 10.

What should I do to render superscripts and subscripts on all devices? Is there any way to 'include' them in my app in case they are not already present?

This is due to android not able to find a Font that supports the rendering of the glyph that you are trying to generate, the usual process is checking /system/etc/system_fonts.xml and if not found it tries to check in the fallback_fonts.xml

You can check the file here

It is tough to assume all devices carry these rendering capabilities, the best(tough) way to ensure that you are able to display the glyph is by overriding Android's default TextView with a custom component, and drawing the glyph the way you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM