views:

117

answers:

4

Hi experts, I am developing a program drawing text on screen using android NDK in C native code. Could you please tell me how do I render the text? Thank you.

Best regards Michael

+1  A: 

The NDK currently does not offer drawing capabilities beyond OpenGL.

Romain Guy
As a result, I must use OpenGL to render text?
A: 

I've barely worked with Android, and nothing with the NDK, so this may be talking out of my ***, but depending on the app, and if performance isn't a concern, could you generate a bitmap in the C code and pass it up to the parent Java app to display?

Nicholas Knight
yep but how to generate the bitmap? I want to use the system's font
A: 

You'll need to use a C-based text rendering library such as Pango.

Graham Borland
A: 

As Graham already said Pango is an option or if you are willing to do some more work you can also use the freetype library directly to render glyphs. Using freetype directly has the advantage that you only have freetype as dependency.

Frank Meerkötter