Break Arabic Font

2019-06-05 21:03发布

问题:

I am making android app in which I have to give support of Arabic text to those mobiles in which Arabic is not present.

I successfully did this in widgets(textview, button etc) by adding following code.

I ahve added dejavusans.ttf file in assests folder. and in code I added

    TypeFace typeFace = Typeface.createFromAsset(context.getAssets(), "dejavusans.ttf"); 
fieldName.setTypeface(typeFace);   
fieldName.setText(ArabicUtilities.reshape(resources.getString(R.string.bring_financial_arabic)));

But the problem is with WebView. The text of webView is breaking. I saw different solutions including How to change font face of Webview in Android?. But no one is working fine. Here is the snapshot. The title(TextView) is looking fine but the webpage text is breaking.

If anyone know its answer then please help.

Thanks

回答1:

I found a solution of this problem.

I used the following tool http://www.arabic-keyboard.org/photoshop-arabic/

I pasted my arabic in it and copy the result then I pasted the result in my html file. The result is like this.

Although it is not 100 percent accurate but it is much better than previous one.



回答2:

U can use adobe indesign for your arabic text and after paste all paragraph text to indesign , you should copy, then paste to photoshop from adobe indesign, every texts will be Okay.