X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fpdf%2FGFXOutputDev.cc;h=441a92b003e72bd1f4c2779baba3af01c311b43c;hb=711659af8759d3939ef395e04f81191a43049a19;hp=2c90c92d460059349d8162f2c81f7457ddc3ba4e;hpb=727449f065760e1d99735f44638c25678cd8bc52;p=swftools.git diff --git a/lib/pdf/GFXOutputDev.cc b/lib/pdf/GFXOutputDev.cc index 2c90c92..441a92b 100644 --- a/lib/pdf/GFXOutputDev.cc +++ b/lib/pdf/GFXOutputDev.cc @@ -419,6 +419,7 @@ char* fontconfig_searchForFont(char*name) fontfile_t*fd = global_fonts; while(fd) { FcConfigAppFontAddFile(config, (FcChar8*)fd->filename); + msg(" Adding font %s to fontconfig", fd->filename); fd = fd->next; } @@ -432,17 +433,21 @@ char* fontconfig_searchForFont(char*name) if(getLogLevel() >= LOGLEVEL_TRACE) { int t; - for(t=0;tnfont;t++) { - char*fcfamily=0,*fcstyle=0,*filename=0; - FcBool scalable=FcFalse, outline=FcFalse; - FcPatternGetString(set->fonts[t], "family", 0, (FcChar8**)&fcfamily); - FcPatternGetString(set->fonts[t], "style", 0, (FcChar8**)&fcstyle); - FcPatternGetString(set->fonts[t], "file", 0, (FcChar8**)&filename); - FcPatternGetBool(set->fonts[t], "outline", 0, &outline); - FcPatternGetBool(set->fonts[t], "scalable", 0, &scalable); - if(scalable && outline) { - msg(" %s-%s -> %s", fcfamily, fcstyle, filename); + int p; + for(p=0;p<2;p++) { + for(t=0;tnfont;t++) { + char*fcfamily=0,*fcstyle=0,*filename=0; + FcBool scalable=FcFalse, outline=FcFalse; + FcPatternGetString(set->fonts[t], "family", 0, (FcChar8**)&fcfamily); + FcPatternGetString(set->fonts[t], "style", 0, (FcChar8**)&fcstyle); + FcPatternGetString(set->fonts[t], "file", 0, (FcChar8**)&filename); + FcPatternGetBool(set->fonts[t], "outline", 0, &outline); + FcPatternGetBool(set->fonts[t], "scalable", 0, &scalable); + if(scalable && outline) { + msg(" %s (%s) -> %s", fcfamily, fcstyle, filename); + } } + set = FcConfigGetFonts(config, FcSetApplication); } } } @@ -450,6 +455,8 @@ char* fontconfig_searchForFont(char*name) char*family = strdup(name); char*style = 0; char*dash = strchr(family, '-'); + if(!dash) dash = strchr(family, ','); + FcPattern*pattern = 0; if(dash) { *dash = 0; @@ -506,7 +513,7 @@ static DisplayFontParamKind detectFontType(const char*filename) DisplayFontParam *GFXGlobalParams::getDisplayFont(GString *fontName) { - msg(" looking for font %s in global params", fontName->getCString()); + msg(" looking for font %s", fontName->getCString()); char*name = fontName->getCString(); @@ -565,8 +572,10 @@ DisplayFontParam *GFXGlobalParams::getDisplayFont(GString *fontName) } free(filename); return dfp; + } else { + msg(" Font %s not found\n", name); + return GlobalParams::getDisplayFont(fontName); } - return GlobalParams::getDisplayFont(fontName); } GFXOutputDev::GFXOutputDev(InfoOutputDev*info, PDFDoc*doc) @@ -589,6 +598,7 @@ GFXOutputDev::GFXOutputDev(InfoOutputDev*info, PDFDoc*doc) this->user_clipy1 = 0; this->user_clipx2 = 0; this->user_clipy2 = 0; + this->current_gfxfont = 0; this->current_fontinfo = 0; this->current_text_stroke = 0; this->current_text_clip = 0; @@ -1227,7 +1237,7 @@ void GFXOutputDev::fillGfxLine(GfxState *state, gfxline_t*line, char evenodd) gfxcolor_t col = getFillColor(state); if(getLogLevel() >= LOGLEVEL_TRACE) { - msg(" %sfill %02x%02x%02x%02x%s", evenodd?"eo":"", col.r, col.g, col.b, col.a); + msg(" %sfill %02x%02x%02x%02x", evenodd?"eo":"", col.r, col.g, col.b, col.a); dump_outline(line); } device->fill(device, line, &col); @@ -1877,6 +1887,13 @@ void GFXOutputDev::restoreState(GfxState *state) { } if(states[statepos].state!=state) { msg(" bad state nesting"); + if(verbose) { + int t; + for(t=0;t<=statepos;t++) { + printf("%08x ", states[t].state); + } + printf("\n"); + } exit(1); } states[statepos].state=0; @@ -2654,11 +2671,7 @@ void GFXOutputDev::endTransparencyGroup(GfxState *state) this->device = states[statepos].olddevice; if(!this->device) { - msg(" Bad state nesting in transparency group"); - msg(" Notice: this is a known problem, which will be fixed in 0.9.1"); - msg(" In the meantime, please convert the file with -s poly2bitmap"); - restoreState(state); - this->device = states[statepos].olddevice; + msg(" Invalid state nesting"); } states[statepos].olddevice = 0;