Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Render text in purely native Android app

I have a purely native Android NDK app, and need to render some text at every frame. I have read posts saying that I need to create a single image file with all the characters of my font, and then render each character as a quad from this image. This sounds like a lot of work and I don't know where to obtain such an image file for a simple font, like Arial. Is there an alternative, easier approach to drawing text in a purely native Android app?

Or, where can I retrieve such an image file to make my own font renderer?

like image 867
lost_bits1110 Avatar asked Aug 23 '11 17:08

lost_bits1110


1 Answers

You might want to see if you can integrate a font renderer into your app. FreeType is a popular one that is written in pure C with no external dependencies which make it easy to use. OGLFT is a version of FreeType that renders to OpenGL. I would do a little more research to see if there are alternatives that may be a better fit but these seem to be pretty good.

This seems to be even better.

like image 86
Jasoneer Avatar answered Sep 28 '22 04:09

Jasoneer