简体   繁体   English

WxWidgets GLCanvas中的跨平台字体

[英]Cross-platform fonts in WxWidgets GLCanvas

I'm developing a cross-platform app w/ wxWidgets and opengl... 我正在开发带有wxWidgets和opengl的跨平台应用程序...

I'm not sure what the best way is to have fonts work in the glcanvas. 我不确定使字体在glcanvas中工作的最佳方法是什么。 I've tried using FTGL but I think the version included in Fedora 11 must be broken or something since I can't get the example code on the web site to compile. 我尝试使用FTGL,但是我认为Fedora 11中包含的版本必须损坏或某些东西,因为我无法在网站上获得示例代码进行编译。 I could try using GLUT or SDL but I'm not sure I want to include those as dependencies... 我可以尝试使用GLUT或SDL,但不确定是否要将它们作为依赖项包括在内...

EDIT: Turns out it's just a different version than the one that is documented on the web site and has a completely different API. 编辑:事实证明,这只是一个与网站上记录的版本不同的版本,并且具有完全不同的API。

Even if I have a font library though, all the ones I've seen require a path to a font file, and I have no idea how to do that in a cross-platform manner. 即使我有一个字体库,我所看到的所有字体库都需要一个指向字体文件的路径,而且我也不知道如何以跨平台的方式进行操作。

Transliterate this tutorial to C++ and array-embed a gzipped copy of the GNU Unifont . 本教程音译为C ++,并数组嵌入 GNU Unifont的压缩副本。 QuesoGLC might also be an option, but watch out for performance gotchas. QuesoGLC也可能是一个选项,但请注意性能问题。

All platforms deal with fonts differently. 所有平台处理字体的方式都不同。 There is no cross platform way to find fonts on a system. 没有跨平台的方法可以在系统上查找字体。 Alternatives include... 替代品包括...

  • Package your fonts with your app so you know where they are. 将字体与应用程序打包在一起,以便知道它们在哪里。
  • Convert the fonts to a binary blob and embed them in your app. 将字体转换为二进制blob并将其嵌入到您的应用程序中。
  • Test for the OS and set the font path accordingly. 测试操作系统并相应地设置字体路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM