Search code examples
androidandroid-ndkfreetypefreetype2

How do I include a font file (.ttf) in my Android NDK project?


So I need to include a .ttf font file for Freetype font rendering in my Android NDK project. Where do I put it so that it will be put in the apk?


Solution

  • In src/main/ I created another folder assets/ alongside the java/, jni/, and res/ folders where I placed the .ttf file and it was uploaded to the apk. I'm still trying to get Freetype to see it as the current command isn't getting it:

    FT_New_Face(ft, "/assets/Arial.ttf", 0, &face);
    

    But that's another question.