我如何在 Glut - Fungen - Haskell 中使用其他字体
我正在使用 Haskell 的 Fungen 框架,并且有一个使用 BitmapFonts 的函数。问题是,我唯一可以使用的 BitmapFont 是 GLUT 附带的 BitmapFont,这里是数据:
data BitmapFont =固定8By13 |固定9By15 |时代罗马10 |时代罗马24 |黑体10 |黑体12 | Helvetica18
这些字体对于我的应用程序来说非常小,我想使用另一种 BitmapFont,而不仅仅是这些,或者使其中一个更大。我该怎么做呢?
I'm using the Fungen framework for Haskell and there is a function that uses BitmapFonts. The thing is, that the only BitmapFonts I can use are the ones that come with GLUT, here is the data:
data BitmapFont
= Fixed8By13
| Fixed9By15
| TimesRoman10
| TimesRoman24
| Helvetica10
| Helvetica12
| Helvetica18
These fonts are very small for my application, and I want to use another BitmapFont, not just these, or make one of these bigger. How can I do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是 putGameText:
据我了解,FunGENn 的 Text 类型将字体限制为固定大小 BitMapFont:
但 renderString 可以还取一个StrokeFont ,其字体系列受到更多限制,但响应标准 OpenGL 缩放/变换/旋转。
因此,一个好的开始可能是让 myPutGameText 接受支持 StrokeFont 的 MyText 并在渲染之前进行缩放变换。这是一些伪代码,我希望有人能纠正:
为了更丰富的字体渲染,答案可能是集成类似 的内容FTGL。
Here's the source of putGameText:
As I understand it, FunGEn's Text type constrains font to a fixed-size BitMapFont:
but renderString can also take a StrokeFont, which is even more limited in font family but responds to standard OpenGL scaling/transformation/rotation.
So, a good start might be to make myPutGameText that accepts a StrokeFont-capable MyText and does a scaling transform before rendering. Here's some pseudo-code which I hope someone will correct:
For richer font rendering, the answer is probably to integrate something like FTGL.