I am not able to understand why, despite mentioning the utf-8 encoding in the string.xml code, the "ddd" is not being encoded to the required font (DevLys 180, a Hindi font).
I've copied this code from the internet to get Hindi to work in my app:
Main.Activity java:
package com.example.spk.muni_darshan;
import android.app.Activity;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
public class MainActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView tv = (TextView) findViewById(R.id.titleText);
Typeface font = Typeface.createFromAsset(getAssets(),
"font/DevLys 180.ttf");
tv.setTypeface(font);
}
string.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Muni_Darshan</string>
<string name="font">font</string>
<string name="title">ddddd</string>
</resources>
activity_main.xml:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title"
android:id="@+id/titleText"
android:textSize="@dimen/abc_action_bar_default_height_material"
android:fontFamily="@string/font" />