1diff --git a/poppler/GlobalParamsWin.cc b/poppler/GlobalParamsWin.cc 2index f989fb8..7ec1b8f 100644 3--- a/poppler/GlobalParamsWin.cc 4+++ b/poppler/GlobalParamsWin.cc 5@@ -79,7 +79,8 @@ static struct { 6 {"Times-Italic", "n021023l.pfb", "timesi.ttf"}, 7 {"Times-Roman", "n021003l.pfb", "times.ttf"}, 8 // TODO: not sure if "wingding.ttf" is right 9- {"ZapfDingbats", "d050000l.pfb", "wingding.ttf"}, 10+// no, the symbol sets are quite different 11+ {"ZapfDingbats", "d050000l.pfb", NULL}, 12 13 // those seem to be frequently accessed by PDF files and I kind of guess 14 // which font file do the refer to 15@@ -153,6 +154,11 @@ static struct { 16 17 #define FONTS_SUBDIR "\\fonts" 18 19+/* mingw32 lacks this symbol, so add it here if necessary */ 20+#ifndef SHGFP_TYPE_CURRENT 21+#define SHGFP_TYPE_CURRENT 0 22+#endif 23+ 24 static void GetWindowsFontDir(char *winFontDir, int cbWinFontDirLen) 25 { 26 BOOL (__stdcall *SHGetSpecialFolderPathFunc)(HWND hwndOwner, 27@@ -239,7 +245,7 @@ void GlobalParams::setupBaseFonts(char * dir) 28 if (displayFonts->lookup(fontName)) 29 continue; 30 31- if (dir) { 32+ if (dir && displayFontTab[i].t1FileName) { 33 GooString *fontPath = appendToPath(new GooString(dir), displayFontTab[i].t1FileName); 34 if (FileExists(fontPath->getCString())) { 35 AddFont(displayFonts, fontName, fontPath, displayFontT1); 36@@ -274,10 +280,15 @@ DisplayFontParam *GlobalParams::getDisplayFont(GfxFont *font) { 37 DisplayFontParam * dfp; 38 GooString * fontName = font->getName(); 39 char * substFontName = NULL; 40+ char appDir[MAX_PATH]; 41 42 if (!fontName) return NULL; 43 lockGlobalParams; 44- setupBaseFonts(NULL); 45+ if (::GetModuleFileName(0, appDir, MAX_PATH) > 0) 46+ setupBaseFonts(appendToPath(grabPath(appDir), "fonts")->getCString()); 47+ else 48+ setupBaseFonts(NULL); 49+ 50 dfp = (DisplayFontParam *)displayFonts->lookup(fontName); 51 if (!dfp) { 52 substFontName = findSubstituteName(fontName->getCString()); 53 54