How can I detect system Chinese, Korean, and Engli

2019-06-28 05:07发布

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

1条回答
Summer. ? 凉城
2楼-- · 2019-06-28 05:28

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.

查看更多
登录 后发表回答