bettermanlu
bettermanlu

Reputation: 655

How to display Korean Words in android app

On some android cellphones, which do not install Korean fonts, when displaying Korean words in an android app, they can't be displayed readable. How to handle such situation in android apps? Is there a convenient way to solve such issue? Must my app install a Korean font? I am a starter on android, I am a little bit confused, if all the Korean strings are encoded with Unicode, shouldn't they be displayed readable?

Thanks a ton.

Upvotes: 1

Views: 3316

Answers (1)

GameDroids
GameDroids

Reputation: 5662

You might be right about the font. When you have a String containing Korean characters, it is not necessarily supported by all font types. If you want to make sure, that those Strings get displayed properly, use your own font. Here you can find some font types that support Korean.

In another thread on SO, they discussed how to include your own font in Android. Basically there are these steps:

  1. copy the font in your project's folder (myProject/assets/fonts)
  2. load the font in your project
  3. set some text to use that font

Example:

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Typeface myTypeFace = Typeface.createFromAsset(getAssets(), "fonts/myKoreanFont.ttf");      // that's how you load your font
    TextView myTextView = (TextView) findViewById(R.id.myKoreanText);
    myTextView.setTypeface(myTypeFace);        // that's how you use your font
}

Here is another example tutorial on how to use fonts. But the technique is basically the same.

Upvotes: 1

Related Questions