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