How to add external 3D fonts to your Android applications


SDK Version: 
M3
Step 1.
First, go to google.com, and find an eye-candy font, that you like the most. Look for „free 3d fonts”. I'm going to use this one: http://www.urbanfonts.com/fonts/Xtrusion.htm
After you have downloaded it, unzip if it is zipped.

Step 2.
Go to your project's location, open the „assets” folder, and create a new folder called „fonts”.
Copy and Paste your „xy.ttf” font to this new directory.

Step 3.
If you are using Eclipse, don't forget to refresh your project's directory tree, make sure your SDK can see your font file.

  1. /* Setting up fonts */
  2. Typeface fontFace = Typeface.createFromAsset(getAssets(), "fonts/xtrusion.ttf");
  3. Typeface fontFace2 = Typeface.createFromAsset(getAssets(), "fonts/other.ttf");
  4. TextView someText = (TextView)findViewById(R.id.TextView01);
  5. TextView someOtherText = (TextView)findViewById(R.id.TextView02);
  6.        
  7. someText.setTypeface(fontFace);
  8. someText.setTextSize(40.f);
  9. someText.setText("Hello Android");
  10.        
  11. someOtherText.setTypeface(fontFace2);
  12. someOtherText.setTextSize(55.f);
  13. someOtherText.setText("Some other text");

That's all! Hope you learned something new. Please feel free to ask questions or to share your ideas as well.

Comments

Great things you have always shared with us. Just keep writing this kind of posts.Thanks MDF Board

Thank you - the site very very nice

المجتمع المصري هو مجتمع يحب الترفية حيث ان سكان مصر تصل الى تسعون مليون فرد ولذلك نحن نقدم خدمة دردشة مصرية لكل اهل مصر ام الدنيا , وتعتبر مصر متقدمة فى هذا العالم من حيث النمو فى مجالات التكنولوجيا و الكمبيوتر بنسبة كبيرة جدا لذلك نفضل دخول شات مصري اكبر تجمع بنات و شباب فى شات الحب و اجمل بنات فى دردشة دردشة الحب , اضافة الى ذلك حيث يوجد دردشة قوية تضم جميع محافظات مصر هي شات مصرية الكتابية نتمني لكم قضاء وقت ممكن فى شات الاصدقاء و احلي دردشة التعارف الذي يوجد به بنات رومانسية فى دردشة بنات مصر المصرية


شات الحب - دردشة مصرية - شات - شات مصري - شات حب - دردشة - دردشة كتابية - دردشة الحب - شات حبنا - شات حبي - شات مصرية - دردشة حب - شات بنات - دردشة مصر - دردشة بنات مصر - شات بنات مصر - شات صوتي - chat love - دردشة ياحبي - شات بنات لبنان - الحب - شات خليجي - شات كتابي - منتدي ياحبي - شات مصر - دردشة حبنا - العاب بنات - العاب تلبيس البنات - العاب - دردشة بنات - شات ياحبي - ياحبي - شات لبناني - شات كلامنجي - دردشة كلامنجي - كلامنجي - شبكة - تصميم مواقع - تصميم - شات الاسكندرية - شات القاهرة - شات المنصورة - شات الزقازيق - دردشة لبنانية - دردشة بنات لبنان - بنات لبنان - شات لبنان - موقع شات - سعودي كول - شات سعودي كول - شات سعودي - دردشة بنت مصر - شات بنت مصر - شات سوريا - شات سكس

Nice post.Thank you for taking the time to publish this information very useful!I’m still waiting for some interesting thoughts from your side in your next post thanks. frigidaire dehumidifier
Get your Ex Back

Impressive site thanks for the very interesting and useful post.
paye
tax accountant
tax advice

I really learned a lot from this blog. Thanks for posting it, and the content of this blog was great also. Good job. thesis editing

I was very pleased to find this site.I wanted to thank you for this great read.
windows hosting | forex vps

I have been searching for some information about it almost three hours. You helped me a lot indeed and reading this your article I have found many new and useful information about this subject. the diet solution

When my cancer was diagnosed I was in last stage with the cancer spread from one testicle to abdomen and throughout both lungs Watch Winder. After testicle removal and 4 rounds of the Einhorn Series chemo, all signs of cancer were gone. Urologists/oncologists wanted to remove all the lymph nodes "to err on the side of caution." But from what I was reading in medical library, there seemed no better survival rate for those who had the lymph node removal. I got a second opinion from an oncologist who contacted the University of Indiana on my Dual Watch Winder behalf. I was advised the lymph node disection would not offer me any real benefit, while almost certainly preventing me from ever ejaculating again. It would seem there are quality of life issues with this surgery, as well as cost/benefit issues that some doctors will be happy to make for you if one does not take the responsibility to make them for themselves, and to get second Single Watch Winderand third opinion if necessary. It was 1983 and I elected to forego the lymph node disection. It was a good decision for me.

I found this tutorial while searching for new class I have noticed your website a while ago, just never really got a chance to post anything back. I found it to be very useful and would like to see if you are able to get in touch with me and maybe we can have a discussion on a few of these.

I thank the very Code, which provides management services Almmmezp each member who participates Bmodia deals and the progress of the new and more Thank you
شات

I thank the very Code, which provides management services Almmmezp each member who participates Bmodia deals and the progress of the new and more Thank you
شات
دردشة
شات مصرى
شات مصرية
دردشة مصرية
دردشة مصر
منتديات بحبك
شات بنات
شات مصر
شات بنات مصر
العاب
دليل
اختصار روابط
منتدى بحبك

I guess it depends More panturrilha about this in This is a nice piece of coding you've aumento peniano . Just like magic you get . You have also to look in the cirurgia plastica . More than all its time to peitos . When you talk about otoplastia , its best to see seios . shared here. I had heard about ViewFlipper but did not know much about it. lipoaspiração , but also on the type of app we are talking about. I can easily imagine brand apps or catalog fimose or the espinhas . When people try to emagrecer there are always the perder barriga com cirurgiao plastico or lipoescultura in the big apps that use 3D fonts because they look good and readibility is not much of an issue

Go to cool impotencia and informative content i really enjoying reading it ginecomastia your project's location, open the „assets” folder, and create a new folder even the article about hidrolipo is good when you start to bioplastia . O peeling is also better abdominoplastia called „fonts”.
Copy and Paste your „xy.ttf” font to this new directory.

Step 3.
If you are using Eclipse, When you start to think in rinoplastia , that’s when you should worry about botox Always there are people that try to get barriga tanquinho don't forget to refresh your project's directory tree, make sure your SDK can see your font file.

We can give them a good education that they can use in their life to get a better chance in this life. Im sure with a good education all of us will see the changing that all that kids can have. Mac DVD Ripper

I want add 3D fonts on my phone. These are lovely. Thank you.meilleur prix viagra meilleur prix. herbal herbal erection.

Companies these days are using ergonomic furniture to ensure that there are no injuries from work related hazards. Use an ergonomic chair and feel better comfort in your back and shoulder. översätt

it is sometimes hard to Pandora in a world of adults Pandora Bracelets

Isn't there any way to reference the font resource in XML only? If you use a font in activities and views all over your application, constantly initializing it and setting every TextView to use it is beyond painful.

Thanks for this post which is very useful for me but i think that 3D font aren't so good for apps...

I guess it depends on the type of app we are talking about. I can easily imagine brand apps or catalog apps that use 3D fonts because they look good and readibility is not much of an issue