开发者

Render text in purely native Android app

开发者 https://www.devze.com 2023-03-30 08:19 出处:网络
I have a purely native Android NDK app, and need to render some text at every frame. I have read posts sayi开发者_运维百科ng that I need to create a single image file with all the characters of my fon

I have a purely native Android NDK app, and need to render some text at every frame. I have read posts sayi开发者_运维百科ng 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?


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.

0

精彩评论

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