在GCC下使用Pango + Cairo + Fontconfig使用Visual Studio的字体渲染问题可以正常工作

时间:2010-01-08 00:11:41

标签: visual-studio mingw cairo pango

我有一个大问题,我希望你能帮助我。

我正在将游戏从Linux移植到Windows,并且使用MinGW工作正常(除了一些我不知道如何崩溃,但现在这不是我的问题)

游戏使用Fontconfig(2.4.2-3),Cairo(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下工作。

很抱歉,如果我忘记了某些内容或者我没有发布任何内容,但我不知道该发布什么内容。

有人有一些提示吗?

提前感谢您的帮助,如果我不清楚,请随时提出。

1 个答案:

答案 0 :(得分:2)

你需要将Pango正在使用的字体设置为Windows机器上实际存在的字体,Bitstream和Sans都不存在,这就是Pango告诉你的(默认是Sans)。尝试将其设置为Segoe UI,您应该看到文本