X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fpdf%2FGFXOutputDev.cc;h=dee94f94fda61ac94161bff4ea12dce7f8cd6587;hp=3e956ec8280058f55f1a666ef8069c509dc23691;hb=5e60b81690ac5883abe4f68b61814b8764604fd1;hpb=5c7bc47d1c32e31480960d7a1ab5419628b505ff diff --git a/lib/pdf/GFXOutputDev.cc b/lib/pdf/GFXOutputDev.cc index 3e956ec..dee94f9 100644 --- a/lib/pdf/GFXOutputDev.cc +++ b/lib/pdf/GFXOutputDev.cc @@ -448,16 +448,18 @@ char* fontconfig_searchForFont(char*name) int t; 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); + if(set) { + 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); @@ -994,7 +996,8 @@ GBool GFXOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading) colToByte(color2.c[0]), colToByte(color2.c[1]), colToByte(color2.c[2])); infofeature("radial shaded fills"); - gfxgradient_t*g = (gfxgradient_t*)malloc(sizeof(gfxgradient_t)*3); + gfxgradient_t gr[3]; + gfxgradient_t*g = &gr[0]; g[0].next = &g[1]; g[1].next = &g[2]; g[2].next = 0; @@ -2415,8 +2418,8 @@ void GFXOutputDev::drawGeneralImage(GfxState *state, Object *ref, Stream *str, } else { msg(" resampling %dx%d to mask size (%dx%d)", width, height, maskWidth, maskHeight); gfxcolor_t*newpic=new gfxcolor_t[maskWidth*maskHeight]; - double dx = width / maskWidth; - double dy = height / maskHeight; + double dx = width / (double)maskWidth; + double dy = height / (double)maskHeight; double yy = 0; for(y = 0; y < maskHeight; y++) { double xx = 0; @@ -2661,7 +2664,7 @@ void GFXOutputDev::beginTransparencyGroup(GfxState *state, double *bbox, this->device = (gfxdevice_t*)rfx_calloc(sizeof(gfxdevice_t)); dbg("this->device now %p (old: %p)", this->device, states[statepos].olddevice); - gfxdevice_record_init(this->device); + gfxdevice_record_init(this->device, 0); /*if(!forSoftMask) { ////??? state->setFillOpacity(0.0); @@ -2758,7 +2761,7 @@ void GFXOutputDev::setSoftMask(GfxState *state, double *bbox, GBool alpha, Funct } states[statepos].olddevice = this->device; this->device = (gfxdevice_t*)rfx_calloc(sizeof(gfxdevice_t)); - gfxdevice_record_init(this->device); + gfxdevice_record_init(this->device, 0); dbg("softmaskrecording is %p (dev=%p) at statepos %d\n", states[statepos].softmaskrecording, this->device, statepos);