Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 1.78 KB

File metadata and controls

25 lines (16 loc) · 1.78 KB

Minimum Working Example of FreeType rendering with Android Jetpack compose

Outline

  • The cpp folder contains basic TextRenderer and Type objects for handling rendering (and loading freetpye) and storing a typeface respectively.
  • A (Java JNI) Kotlin interface is defined in main.cpp
  • The Kotlin counterpart for the interface is here
  • To use a different custom font, place it in the assets/fonts folder
  • The main render loop occurs as part of a GLSurfaceView setup
  • The app runs by an activity, launching a simple compose function
Tested on
  • LGE Nexus 5 Physical device (Android 6.0.1)
  • Sony J8110 (Xperia 1, OG) Physical device (Android 11)

Running

All is included, openning as an Android studio project should allow for a straightforward compilation

FreeType2 is vendored with the code README, the CMakeLists.txt could be edited to use some extant version.

example