使用opengles 2创建不同字体的文本

时间:2016-03-01 07:31:50

标签: opengl-es opengl-es-2.0 freetype

我的项目应该在linux环境中使用opengles2在显示器上显示图形叠加。

需要使用opengles2在显示器上以不同字体显示文本。 Freetype库可用于以不同的字体呈现文本,

但我无法找到一个在opengles2 Linux中使用freetype库来渲染不同字体文本的示例程序。

1 个答案:

答案 0 :(得分:0)

我现在不会在任何事情上使用普通的freetype。它缺少很多opentype / unicode智能,很久以前就被移到了其他的库中。所以它将适用于简单的拉丁文本,并且几乎可以解决所有其他问题(包括不是简单的拉丁文本)。

你可以更好地长期使用更高级别的lib来抽象所有文本位(freetype,fontconfig,harfbuzz,freebid等),例如pango cairo,并将其插入opengl es。

一些链接: https://dthompson.us/font-rendering-in-opengl-with-pango-and-cairo.html http://emblemparade.net/blog/using-cairo-with-opengl-es/ http://cairographics.org/OpenGL/