柬埔寨货币符号未正确显示

时间:2017-04-05 11:41:33

标签: android unicode textview currency android-fonts

我正在尝试在Android中显示柬埔寨货币符号(៛)

Cambodian currency symbol

我的Android代码是

tvDetailDescription.setText("៛"); //with string tvDetailDescription.setText("\u17DB"); //with unicode

但它显示如下:

enter image description here

我不知道为什么会这样。

1 个答案:

答案 0 :(得分:0)

默认的Android字体Roboto不包含柬埔寨货币符号。有关支持的字符的概述,请参阅here。使用自定义字体正确显示符号。将字体添加到assets/fonts - 文件夹并按如下方式使用:

    Typeface DosisRegular = Typeface.createFromAsset(mContext.getAssets(), "fonts/Dosis-Regular.otf");
    mDetailDescription.setTypeface(DosisRegular);
相关问题