How to install new unicode font.

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

How to install new unicode font.

Postby hieunguyen » Thu Apr 24, 2008 2:39 pm

Hi, everybody.

I am writing a program which will display unicode characters. But the emulator has no support unicode entirely. I think i should install a unicode font such as Times New Roman, Arial on the emulator.

Please help me if have any way.

Thank you and best regards,
Hieu Nguyen
hieunguyen
Freshman
Freshman
 
Posts: 3
Joined: Thu Jan 10, 2008 3:15 pm
Location: Vietnam

Top

Postby sampath_sl » Tue Apr 27, 2010 12:35 pm

Try this it worked for me:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         public void onCreate(Bundle icicle) {
  2.  
  3.                 super.onCreate(icicle);
  4.  
  5.                 setContentView(R.layout.main);
  6.  
  7.                
  8.  
  9.                 TextView tv=(TextView)findViewById(R.id.custom);
  10.  
  11.                 Typeface face=Typeface.createFromAsset(getAssets(), "fonts/myunicodefont.ttf");
  12.  
  13.                
  14.  
  15.                 tv.setTypeface(face);
  16.  
  17.         }
  18.  
  19.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


in the main.xml:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <TextView
  2.  
  3.                         android:id="@+id/custom"
  4.  
  5.                         android:text="Your Unicode Text"
  6.  
  7.                         android:textSize="10sp"
  8.  
  9.                 />
  10.  
  11.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


I placed the ttf file in the /assets/fonts folder in the project root.
sampath_sl
Developer
Developer
 
Posts: 35
Joined: Sun Apr 11, 2010 4:45 pm
Location: Colombo

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 5 guests