title: How to use custom fonts in Android Studio
body: <p>I am attempting to use a custom font in an Android app. I placed my font files under /app/src/main/assets/fonts, and I reference them with </p>
  
  <pre><code>Typeface.createFromAsset(getApplicationContext().getAssets(), 
  "fonts/magorian_font.ttf")
  </code></pre>
  
  <p>When I run my app, I get the error:</p>
  
  <pre><code>04-23 16:14:40.017 13342-13342/com.pottermore.mandrake.pottermoreapp E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                     Process: com.pottermore.mandrake.pottermoreapp, PID: 13342
                                                                                     java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pottermore.mandrake.pottermoreapp/com.pottermore.mandrake.pottermoreapp.ActivityHome}: java.lang.RuntimeException: Font asset not found magorian_font.ttf
                                                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
                                                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
                                                                                         at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
                                                                                         at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                         at android.os.Looper.loop(Looper.java:154)
                                                                                         at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                                                         at java.lang.reflect.Method.invoke(Native Method)
                                                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
                                                                                      Caused by: java.lang.RuntimeException: Font asset not found magorian_font.ttf
                                                                                         at android.graphics.Typeface.createFromAsset(Typeface.java:206)
                                                                                         at com.pottermore.mandrake.pottermoreapp.ActivityHome.onCreate(ActivityHome.java:34)
                                                                                         at android.app.Activity.performCreate(Activity.java:6679)
                                                                                         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
                                                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
                                                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) 
                                                                                         at android.app.ActivityThread.-wrap12(ActivityThread.java) 
                                                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) 
                                                                                         at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                         at android.os.Looper.loop(Looper.java:154) 
                                                                                         at android.app.ActivityThread.main(ActivityThread.java:6119) 
                                                                                         at java.lang.reflect.Method.invoke(Native Method) 
                                                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
                                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 
  </code></pre>
  
  <p>What am I doing wrong?</p>