I must concentrate to not think about the amount of time wasted on this issue or my brain would melt.
Anyways, in case someone comes across this post I will share what I had to figure out till it worked:
- To get proper error messages from pango register a glib log handler, see below.
- Pango assumes a specific folder-structure relative to the pango dll to look for some files. If the pango dll is located in /foo/bin or /foo it will try to locate "pango.modules" under /foo/etc/pango. That file contains information about where to find the pango module dlls. The easiest way I found was to place the pango module dlls under /foo/lib/pango/1.8.0/modules and then execute "pango-querymodules.exe > pango.modules" to generate the contents of the modules file and then manually remove the path, except for the actual dll filename. See below for the contents on my machine.
- The actual problem which took me days to find out was this: I used SVGs which were exported from Adobe Illustrator and these contain text elements like this
<text style="font-family:'Arial'; font-size:20;">Foo Bar</text>
which looked fine to me, but the single quotation marks around the font family seem to be included and cause Pango to be unable to find the font 'Arial', because the fonts name is of course actually Arial and not 'Arial', if you know what I mean.
Pango message handler
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:*