开发者

How to render text in C (android)?

I am developing a program drawing text on screen using android 开发者_如何学GoNDK in C native code. Could you please tell me how do I render the text? Thank you.

Best regards Michael


The NDK currently does not offer drawing capabilities beyond OpenGL.


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


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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜