2013-04-24 56 views
1

在某些android手机上不安装韩语字体,在android应用程序中显示韩语单词时,它们无法显示可读性。如何处理android应用程序中的这种情况?有没有一种方便的方法来解决这个问题?我的应用程序必须安装韩文字体吗?我是一个Android的启动器,我有点困惑,如果所有的韩文字符串都用Unicode编码,它们不应该显示为可读吗?如何在Android应用程序中显示韩语单词

谢谢了。

回答

1

你可能是对的字体。如果您的String包含韩文字符,则不一定受所有字体类型支持。如果您想确保那些Strings显示正确,请使用您自己的字体。 Here you can find some font types that support Korean

another thread on SO,他们讨论了如何在Android中包含自己的字体。基本上有下列步骤操作:

  1. 副本的字体在项目的文件夹(myProject/assets/fonts
  2. 负荷项目中的字体
  3. 设置一些文本使用的字体

例子:

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 
} 

这是另一个example tutorial关于如何使用字体。但技术基本相同。

相关问题