Android: Using the built-in fonts and adding effects

Post to Twitter

This is the first article in my “five days of Android articles“.

Currently Android has a few built-in fonts that can be easily harnessed in your applications. Today I’m going to quickly go over how to use these as well as some added effects like creating shadows, bold, italic, colors, etc.

I created a new Android Project in Eclipse called “AndroidFonts”:

From here I modified the “main.xml” file in the layout folder.






When I run the project I get this result in the emulator:

As you can see from the code I used the fonts: sans, serif, and monospace. Then I showed off how to make a string bold and italic:


Then a string utilizing the shadowing effect:

android:shadowColor ="#0f0f0f"

Colors are as simple as adding:


Pretty easy!

Post to Twitter

This entry was posted in Android, Open Source. Bookmark the permalink.

2 Responses to Android: Using the built-in fonts and adding effects

  1. Pingback: Five days of Android articles coming next week! « Giant Flying Saucer

  2. Pingback: Using Custom Fonts | Logcat

Comments are closed.