Issue
is it possible to write in another language font with in text view in android for example i have created
TextView tv = new TextView(this);
tv.setText("HEllo Android");
here i have wrote Hello Android in English how i can wrote it in hindi language.
i have used image its working fine
<ImageView android:id ="@+id/header2"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_gravity="center"
android:paddingTop="0dip"
android:src="@drawable/why00learn00spanish_index"
>
<ImageView/>
any help would appreciate.
Solution
Download the OTF hindi file and put it into assets folder. Run the code in an activity
Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/hindi.otf");
TextView tv = (TextView) findViewById(R.id.CustomFontText);
tv.setTypeface(tf)
Answered By - Nitesh Khosla
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.