? attachment.cgi?id=5496 ? mkinstalldirs ? glib/poppler-features.h ? poppler/GlobalParams.cc-merge Index: configure.ac =================================================================== RCS file: /cvs/poppler/poppler/configure.ac,v retrieving revision 1.60 diff -u -r1.60 configure.ac --- configure.ac 16 Aug 2006 09:18:04 -0000 1.60 +++ configure.ac 6 Sep 2006 04:32:00 -0000 @@ -82,7 +82,7 @@ dnl Test for zlib AC_ARG_ENABLE(zlib, AC_HELP_STRING([--disable-zlib], - [Don't build against zlib. This is the default value as the zlib code is known to fail in some cases.]), + [Don't build against zlib.]), enable_zlib=$enableval, enable_zlib="no") if test x$enable_zlib = xyes; then Index: goo/gmem.c =================================================================== RCS file: /cvs/poppler/poppler/goo/gmem.c,v retrieving revision 1.5 diff -u -r1.5 gmem.c --- goo/gmem.c 28 Feb 2006 19:59:58 -0000 1.5 +++ goo/gmem.c 6 Sep 2006 04:32:00 -0000 @@ -68,7 +68,7 @@ return NULL; size1 = gMemDataSize(size); if (!(mem = (char *)malloc(size1 + gMemHdrSize + gMemTrlSize))) { - fprintf(stderr, "Out of memory\n"); + fprintf(stderr, "mallocd Out of memory\n"); exit(1); } hdr = (GMemHdr *)mem; @@ -90,7 +90,7 @@ if (size <= 0) return NULL; if (!(p = malloc(size))) { - fprintf(stderr, "Out of memory\n"); + fprintf(stderr, "malloc Out of memory\n"); exit(1); } return p; @@ -131,7 +131,7 @@ else q = malloc(size); if (!q) { - fprintf(stderr, "Out of memory\n"); + fprintf(stderr, "realloc Out of memory\n"); exit(1); } return q; Index: poppler/CairoFontEngine.cc =================================================================== RCS file: /cvs/poppler/poppler/poppler/CairoFontEngine.cc,v retrieving revision 1.23 diff -u -r1.23 CairoFontEngine.cc --- poppler/CairoFontEngine.cc 29 May 2006 18:44:17 -0000 1.23 +++ poppler/CairoFontEngine.cc 6 Sep 2006 04:32:01 -0000 @@ -75,7 +75,7 @@ error(-1, "Couldn't create temporary font file"); goto err2; } - + printf("embededfontid: %d\n", embRef.num); refObj.initRef(embRef.num, embRef.gen); refObj.fetch(xref, &strObj); refObj.free(); @@ -112,6 +112,7 @@ } } + printf("filename: %s\n", fileName->getCString()); switch (fontType) { case fontType1: case fontType1C: Index: poppler/FlateStream.cc =================================================================== RCS file: /cvs/poppler/poppler/poppler/FlateStream.cc,v retrieving revision 1.2 diff -u -r1.2 FlateStream.cc --- poppler/FlateStream.cc 28 Aug 2005 03:22:04 -0000 1.2 +++ poppler/FlateStream.cc 6 Sep 2006 04:32:01 -0000 @@ -68,6 +68,7 @@ d_stream.avail_out = sizeof(out_buf); d_stream.next_out = out_buf; out_pos = 0; +refill: /* buffer is empty so we need to fill it */ if (d_stream.avail_in == 0) { int c; @@ -79,12 +80,17 @@ } while (d_stream.avail_out && d_stream.avail_in && (status == Z_OK || status == Z_BUF_ERROR)) { status = inflate(&d_stream, Z_SYNC_FLUSH); + //printf("inflate() = %d avail_in %d avail_out %d\n", status, d_stream.avail_in, d_stream.avail_out); } out_buf_len = sizeof(out_buf) - d_stream.avail_out; if (status != Z_OK && status != Z_STREAM_END) return -1; - if (!out_buf_len) - return -1; + if (!out_buf_len) { + if (status == Z_OK) + goto refill; + else + return -1; + } } return 0; Index: poppler/FlateStream.h =================================================================== RCS file: /cvs/poppler/poppler/poppler/FlateStream.h,v retrieving revision 1.2 diff -u -r1.2 FlateStream.h --- poppler/FlateStream.h 16 Sep 2005 18:29:18 -0000 1.2 +++ poppler/FlateStream.h 6 Sep 2006 04:32:01 -0000 @@ -57,7 +57,7 @@ z_stream d_stream; StreamPredictor *pred; int status; - unsigned char in_buf[4096]; + unsigned char in_buf[1]; unsigned char out_buf[4096]; int out_pos; int out_buf_len; 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);