使用 Pango 的字体渲染问题 +开罗 +使用 Visual Studio 的 Fontconfig,在 GCC 下工作正常
我有一个很大的问题,我希望你能帮助我。
我正在将游戏从Linux移植到Windows,并且使用MinGW工作正常(除了一些我不知道如何发生的崩溃,但这不是我现在的问题)
游戏使用Fontconfig(2.4.2-3),开罗( 1.8.8) 和 Pango (1.26.0) 来渲染文本。
问题是,使用 Visual Studio,我看不到字体(所有字符都显示为小框),并且在输出中它对我说:
** (performous.exe:4344): CRITICAL **: No modules found:
No builtin or dynamically loaded modules were found.
PangoFc will not work correctly.
This probably means there was an error in the creation of:
'D:\Project\PerformousInstall-vc\etc\pango\pango.modules'
You should create this file by running:
pango-querymodules > 'D:\Project\PerformousInstall-vc\etc\pango\pango.modules'
** (performous.exe:4344): WARNING **: couldn't load font "Bitstream Charter Not-Rotated 18px", falling back to "Sans Not-Rotated 18px", expect ugly output.
** (performous.exe:4344): WARNING **: couldn't load font "Sans Not-Rotated 18px", falling back to "Sans Not-Rotated 18px", expect ugly output.
** (performous.exe:4344): WARNING **: All font fallbacks failed!!!!
** (performous.exe:4344): WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderWin32', script='latin'
** (performous.exe:4344): WARNING **: All font fallbacks failed!!!!
此错误仅在我使用 Visual Studio 时出现,但因为它解决了我很多问题的其他错误,我将非常有兴趣让字体在 VS 下工作。
抱歉,如果我忘记了什么或者我没有发布任何内容,但我不知道该发布什么。
有人有一些提示吗?
预先感谢您的帮助,如果我不清楚,请随时询问。
I have a big problem, and I hope you can help me.
I'm porting a game from Linux to Windows, and using MinGW works fine (except for some crashes that I don't know how, but this is not my problem now)
Game use Fontconfig (2.4.2-3), Cairo (1.8.8) and Pango (1.26.0) to render text.
Problem is that, using Visual Studio, I can't see fonts (all characters are displayed as little box), and in the output it say me this:
** (performous.exe:4344): CRITICAL **: No modules found:
No builtin or dynamically loaded modules were found.
PangoFc will not work correctly.
This probably means there was an error in the creation of:
'D:\Project\PerformousInstall-vc\etc\pango\pango.modules'
You should create this file by running:
pango-querymodules > 'D:\Project\PerformousInstall-vc\etc\pango\pango.modules'
** (performous.exe:4344): WARNING **: couldn't load font "Bitstream Charter Not-Rotated 18px", falling back to "Sans Not-Rotated 18px", expect ugly output.
** (performous.exe:4344): WARNING **: couldn't load font "Sans Not-Rotated 18px", falling back to "Sans Not-Rotated 18px", expect ugly output.
** (performous.exe:4344): WARNING **: All font fallbacks failed!!!!
** (performous.exe:4344): WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderWin32', script='latin'
** (performous.exe:4344): WARNING **: All font fallbacks failed!!!!
This error is only when I use Visual Studio, but because it fix me a lot of other bugs, I'll be very interested to get fonts working under VS.
Sorry if I forgot something or I haven't posted anything, but I have no idea what to post.
Someone has some hints?
Thanks in advance for help, if I don't get myself clear, feel free to ask.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将 Pango 使用的字体设置为 Windows 计算机上实际存在的字体,Bitstream 和 Sans 都不存在,这就是 Pango 告诉您的内容(默认为 Sans)。尝试将其设置为 Segoe UI,您应该会看到文本
You need to set the fonts that Pango are using to something that actually exists on a Windows machine, neither Bitstream nor Sans exist and that's what Pango is telling you (its default is Sans). Try setting it to Segoe UI and you should see text