安卓:阿拉伯字体 [英] Android: Arabic font

查看:566
本文介绍了安卓:阿拉伯字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图解析其中包含复杂的阿拉伯字母的XML文件。

I am trying to parse an XML file which contains complex arabic letters ..

当我测试在Android 2.3.7,并非所有的阿拉伯字母都支持,仍存在一些复杂的显示为正方形。

When i tested on android 2.3.7, not all arabic letters are supported, there is still some complex ones appear as squares ..

但是,当在Android 4.0.4测试,所有字母出现伟大的..

But when tested on android 4.0.4, all letters appear great ..

我需要找到在4.0.4中使用的.TTF阿拉伯字体或最好的Andr​​oid阿拉伯字体,迫使它在我的应用程序很好地工作在所有版本中,你能帮助我吗?

I needed to find the .ttf arabic font used in 4.0.4 or the best android arabic font to force it in my application to work fine on all versions, can you help me please?

我试图DroidNaskh-Regular.ttf和DroidSansArabic.ttf,但不一样的Andr​​oid这样的4.0.4 ..

I tried DroidNaskh-Regular.ttf and DroidSansArabic.ttf but not the same like android 4.0.4 ..

谢谢..

推荐答案

尝试此解决方案:

获得roboto字体。如果不工作,你可以尝试其他字体,如的DejaVu 字体。其他字体可用这里例如。

get the roboto font as used on android 4 , from here. if that doesn't work , you can try out other fonts , such as the DejaVu font . other fonts are available here for example .

那么,把文件放到你的资产的文件夹,并为每一个需要显示的文本(如TextView的)的意见,使用的字体:

then , put the file into your assets folder , and for each of the views that need to show text (like textView) , use the font :

Typeface face = Typeface.createFromAsset(getAssets(), "Roboto-Regular.ttf");
textview.setTypeface(face);

我试过希伯来语在过去,它显示的罚款。可悲的是,特殊点(称为NIKUD)并没有表现出这么好,所以你可能有阿拉伯语类似的问题。

i've tried hebrew in the past and it showed fine . sadly , the special dots (called "NIKUD") didn't show so well so you might have similar problems for arabic .

这篇关于安卓:阿拉伯字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆