I am working on a simple little app which uses some different fonts. I have searched the board and have found a few
other threads on this subject. I decided to implement what I needed in the following code (Not sure if it is correct though):
Using java Syntax Highlighting
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- Typeface myTypeface = Typeface.createFromAsset(getAssets(), "fonts/teletype.ttf");
- ScoreText = (TextView) findViewById(R.id.TextView01);
- ScoreText.setTypeface(myTypeface);
- }
Parsed in 0.029 seconds, using GeSHi 1.0.8.4
The problem I am having is that when I create the "fonts" folder in the Android project (Using Eclipse 3.4/ADT) I get an project error.
If I put the ttf file in another folder (i.e. raw) inside my project it will compile but the font is not found or loaded. Anyone have any similar issues or know how to resolve this.
Thanks in advance for your help.
-Stover




