I have a webview which has an arabic content and I've tried to change the default font with custom one (which is an arabic font) as described here but with no success. So how can i do that?
any help will be appreciated.
Edit: this is my code:
// Prepare html page
String fontFamily = "@font-face {"
+ "font-family: 'ARABTYPE';"
+ "src: url('file:///android_asset/fonts/ARABTYPE.TTF');} "
+ "body {font-family: 'ARABTYPE';font-size: large;text-align: justify;}";
String mHTMLHeader = "<html><head><style type=\"text/css\">\n"
+ fontFamily + "\n</style></head><body><div dir='rtl'>";
String arabicText = "السلام عليكم ورحمة الله";
String mHTMLFooter = "</div></body></html>";
String mHtml = mHTMLHeader + "<div dir='rtl'>" + arabicText
+ "</div>" + mHTMLFooter;
WebView mBrowser;
mBrowser = (WebView) findViewById(R.id.myWebView);
mBrowser.getSettings().setSupportZoom(true);
mBrowser.getSettings().setBuiltInZoomControls(true);
mBrowser.getSettings().setJavaScriptEnabled(true);
mBrowser.getSettings().setDisplayZoomControls(false);
mBrowser.loadDataWithBaseURL("file:///android_asset/", mHtml, "text/html", "UTF-8", "");