我正在使用librsvg将SVG文件呈现给Cairo上下文。然后我使用Pango“手动”在顶部渲染一些文本。
渲染SVG时,我收到Pango警告无法加载字体:
"couldn't load font "'Calibri' Not-Rotated 16", falling back to "Sans Not-Rotated 16", expect ugly output."
之后通过Pango手动文本渲染完美无缺。我尝试了多种不同的字体系列,它们都可以很好地呈现,没有任何警告。
我甚至浏览了librsvg源代码,看看它是如何使用Pango但我看不出与我正在做的事情有任何重大差异。
我不知道如何继续调试此问题,任何关于Pango如何在Windows下定位字体以及可能影响其查找能力的建议都非常感谢。
如果重要:
我从这里下载了所有需要的二进制文件:http://sourceforge.net/projects/ezwinports/files/
答案 0 :(得分:5)
我必须集中注意力不要考虑在这个问题上浪费的时间,否则我的大脑会融化。
无论如何,如果有人遇到这篇文章,我将分享我必须弄清楚的事情直到它起作用:
<text style="font-family:'Arial'; font-size:20;">Foo Bar</text>
Pango邮件处理程序
void PangoMessageHandler(const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data)
{
//TODO: handle log message
}
g_log_set_handler("Pango", G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, PangoMessageHandler, NULL);
<强> pango.modules 强>
"pango-arabic-lang.dll" ArabicScriptEngineLang PangoEngineLang PangoRenderNone arabic:*
"pango-basic-win32.dll" BasicScriptEngineWin32 PangoEngineShape PangoRenderWin32 common:
"pango-indic-lang.dll" devaIndicScriptEngineLang PangoEngineLang PangoRenderNone devanagari:*
"pango-indic-lang.dll" bengIndicScriptEngineLang PangoEngineLang PangoRenderNone bengali:*
"pango-indic-lang.dll" guruIndicScriptEngineLang PangoEngineLang PangoRenderNone gurmukhi:*
"pango-indic-lang.dll" gujrIndicScriptEngineLang PangoEngineLang PangoRenderNone gujarati:*
"pango-indic-lang.dll" oryaIndicScriptEngineLang PangoEngineLang PangoRenderNone oriya:*
"pango-indic-lang.dll" tamlIndicScriptEngineLang PangoEngineLang PangoRenderNone tamil:*
"pango-indic-lang.dll" teluIndicScriptEngineLang PangoEngineLang PangoRenderNone telugu:*
"pango-indic-lang.dll" kndaIndicScriptEngineLang PangoEngineLang PangoRenderNone kannada:*
"pango-indic-lang.dll" mlymIndicScriptEngineLang PangoEngineLang PangoRenderNone malayalam:*
"pango-indic-lang.dll" sinhIndicScriptEngineLang PangoEngineLang PangoRenderNone sinhala:*