【问题标题】:Font rendering problems using Pango + Cairo + Fontconfig using Visual Studio, under GCC works fine使用 Pango + Cairo + Fontconfig 使用 Visual Studio 的字体渲染问题,在 GCC 下工作正常
【发布时间】:2010-01-08 08:17:36
【问题描述】:

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

我正在将游戏从 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 下工作。

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

有人有一些提示吗?

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

【问题讨论】:

    标签: visual-studio mingw cairo pango


    【解决方案1】:

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

    【讨论】:

    • 感谢您的回复,我尝试这样做,现在我“只有”这个错误:** (performous.exe:4344): WARNING **: failed to choose a font,预计输出丑陋. engine-type='PangoRenderWin32', script='latin' 不知道怎么解决。也许 PS:也试过“Arial”和“Verdana”,没有效果。模块错误怎么办?我在 Google 上找不到任何有用的东西
    • 进入 GNOME IRC "#pango" 或邮件列表上的 pango 房间,那里的人非常乐于助人和友好
    • 好的,问题解决了:将MinGW下编译好的pango生成的“module-*”复制到Visual C++的pango目录下,倒置第二行每组四个,编译即可。如果有人有问题,请随时与我联系。感谢保罗的回答
    猜你喜欢
    • 1970-01-01
    • 2013-04-12
    • 2016-08-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-08
    • 1970-01-01
    相关资源
    最近更新 更多