Using custom fonts on Android
- by karse23
Hi there,
I'm trying to load a custom font as follows:
private Paint customFont18;
customFont18 = new Paint();
customFont18.setTextSize(18);
Typeface fontFace = Typeface.createFromAsset(getAssets(), "FONT.TTF");
customFont18.setTypeface(fontFace);
The getAssets fails, thows this:
-The method getAssets() is undefined for the type MyClass
-assetManager cannot be resolved to a variable
What is my problem? I've seen several examples like this but none works in my case.
Thanks in advance.