4

My learning app requires displaying Korean, English and Chinese. One solution I have is to embed a Korean/English font and a Chinese font. Then put together a string with different TextFormats.

The thing is, I'm positive that IOS and Android devices should contain native Chinese, Korean and English fonts already, and I'd much rather refer to and use those fonts instead of packing them.

I tried detecting fonts by using Font.enumerateFonts(true), but when I use font.hasGlyphs('你'), I don't get a true, or anything, so I don't know how to choose the proper device font.

If that doesn't work, is there a font that contains all of those Characters? Or maybe a font-builder program that'd allow me to customize a font to include

Keith
  • 4,144
  • 7
  • 25
  • 43
  • Why don't you use "_sans" then? No need to embed that. – Fygo Apr 30 '14 at 18:38
  • Hmm, I tried _sans, and it'll display Korean and English, but not Chinese. Do you know a device font that will? – Keith May 01 '14 at 08:18
  • Hm, sans should do that if the device has the font installed. To be honest I don't know if it comes preinstalled, are you sure it does? In that case simply embed the font. Some font families should contain all the chars (Arial, etc.), I am not a font-master but you can easily check its table. I had problems with hasGlyphs too so if you embed the whole font (which may add a nice few MB to your app), no need to check it. EDIT: Btw, I have just tested on my Galaxy S4 and the Chinese doesn't seem to work, it is not installed (???). – Fygo May 01 '14 at 18:01
  • Yeah, I'll embed as a last resort. But some of the Chinese fonts are 8MB or more, and that seems silly since I swear each device would have a font able to support Chinese. Urgh – Keith May 02 '14 at 04:29
  • My advice would be to not worry about those 8MB - that's nothing compared to the tens of gigabytes of storage that phones now have. – Invictus May 08 '14 at 18:47

1 Answers1

5

This was something that I wrote sometime back http://blogs.adobe.com/airodynamics/2012/08/21/supporting-languages-with-unicode-characters/ Hopefully it helps you

You can always know the name of font specific to the language. May be this http://support.apple.com/kb/HT5878.

Now based on the language you want to show just change the value of font in the statement format.font and the correct language should come up.

Kshitiz Gupta
  • 248
  • 1
  • 3
  • 9