Index: poppler/GlobalParams.cc =================================================================== RCS file: /cvs/poppler/poppler/poppler/GlobalParams.cc,v retrieving revision 1.17 diff -u -r1.17 GlobalParams.cc --- poppler/GlobalParams.cc 4 Feb 2006 20:48:25 -0000 1.17 +++ poppler/GlobalParams.cc 6 Sep 2006 04:32:01 -0000 @@ -1116,7 +1116,7 @@ // this is all heuristics will be overwritten if font had proper info name = font->getName()->getCString(); - + printf("build from name: %s %s\n", name, font->getOrigName()->getCString()); modifiers = strchr (name, ','); if (modifiers == NULL) modifiers = strchr (name, '-'); @@ -1231,7 +1231,12 @@ else lang = "xx"; } else lang = "xx"; - + printf("pattern: family=%s slant=%d weight=%d width=%d spacing=%d lang=%s", family, + slant, + weight, + width, + spacing, + lang); p = FcPatternBuild(NULL, FC_FAMILY, FcTypeString, family, FC_SLANT, FcTypeInteger, slant, @@ -1248,12 +1253,26 @@ DisplayFontParam *GlobalParams::getDisplayFont(GfxFont *font) { DisplayFontParam *dfp; FcPattern *p=0; + GooString *patternString; + FcChar8 *ps; GooString *fontName = font->getName(); if (!fontName) return NULL; lockGlobalParams; - dfp = (DisplayFontParam *)displayFonts->lookup(fontName); + printf("font lname: %s\n", fontName->getCString()); + p = buildFcPattern(font); + printf("underdog\n"); + ps = FcNameUnparse(p); + printf("goo %d", __LINE__); + if (!ps) + printf("bad news guys\n"); + printf("goo %d", __LINE__); + patternString = new GooString((char *)ps); + free(ps); + printf("pattern hash: %s\n", patternString->getCString()); + + dfp = (DisplayFontParam *)displayFonts->lookup(patternString); if (!dfp) { FcChar8* s; @@ -1261,7 +1280,6 @@ FcResult res; FcFontSet *set; int i; - p = buildFcPattern(font); if (!p) goto fin; @@ -1273,6 +1291,7 @@ for (i = 0; i < set->nfont; ++i) { res = FcPatternGetString(set->fonts[i], FC_FILE, 0, &s); + printf(" matches: %s\n", s); if (res != FcResultMatch || !s) continue; ext = strrchr((char*)s,'.'); @@ -1280,13 +1299,13 @@ continue; if (!strncasecmp(ext,".ttf",4) || !strncasecmp(ext, ".ttc", 4)) { - dfp = new DisplayFontParam(fontName->copy(), displayFontTT); + dfp = new DisplayFontParam(patternString->copy(), displayFontTT); dfp->tt.fileName = new GooString((char*)s); FcPatternGetInteger(set->fonts[i], FC_INDEX, 0, &(dfp->tt.faceIndex)); } else if (!strncasecmp(ext,".pfa",4) || !strncasecmp(ext,".pfb",4)) { - dfp = new DisplayFontParam(fontName->copy(), displayFontT1); + dfp = new DisplayFontParam(patternString->copy(), displayFontT1); dfp->t1.fileName = new GooString((char*)s); } else @@ -1296,6 +1315,7 @@ } FcFontSetDestroy(set); } + delete patternString; fin: if (p) FcPatternDestroy(p);