如何在C(android)中渲染文本?

发布于 2024-09-13 14:37:31 字数 85 浏览 1 评论 0原文

我正在开发一个程序,使用 C 本机代码中的 android NDK 在屏幕上绘制文本。您能告诉我如何渲染文本吗?谢谢。

此致 迈克尔

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

︶葆Ⅱㄣ 2024-09-20 14:37:31

NDK 目前不提供 OpenGL 之外的绘图功能。

The NDK currently does not offer drawing capabilities beyond OpenGL.

俯瞰星空 2024-09-20 14:37:31

您需要使用基于 C 的文本渲染库,例如 Pango

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

不…忘初心 2024-09-20 14:37:31

我几乎没有使用过 Android,也没有使用过 NDK,所以这可能是我的胡言乱语,但取决于应用程序,如果性能不是问题,你能在 C 代码中生成位图吗并将其传递给父Java应用程序来显示?

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?

笔芯 2024-09-20 14:37:31

正如格雷厄姆已经说过的,Pango 是一种选择,或者如果你愿意做更多的工作,你
也可以直接使用freetype库来渲染字形。直接使用freetype有
优点是您只有 freetype 作为依赖项。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文