X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fpdf%2FGFXOutputDev.cc;h=b497db5139c4be43c97b61b69d903da4e626e2c9;hb=95d04eff5714c6b79dd865ca297be70cf037fee8;hp=bdd42fbb7886dad5ec8fdd3a1b9e1412ebbb3ea1;hpb=c463a165247bcc2d902f1af1ea0f5566d3bef942;p=swftools.git diff --git a/lib/pdf/GFXOutputDev.cc b/lib/pdf/GFXOutputDev.cc index bdd42fb..b497db5 100644 --- a/lib/pdf/GFXOutputDev.cc +++ b/lib/pdf/GFXOutputDev.cc @@ -368,6 +368,7 @@ GFXOutputDev::GFXOutputDev(InfoOutputDev*info, PDFDoc*doc) this->config_remapunicode=0; this->config_transparent=0; this->config_extrafontdata = 0; + this->config_fontquality = 10; this->gfxfontlist = gfxfontlist_create(); @@ -384,12 +385,17 @@ void GFXOutputDev::setParameter(const char*key, const char*value) this->config_transparent = atoi(value); } else if(!strcmp(key,"extrafontdata")) { this->config_extrafontdata = atoi(value); + } else if(!strcmp(key,"fontquality")) { + this->config_fontquality = atof(value); + if(this->config_fontquality<=1) + this->config_fontquality=1; } else if(!strcmp(key,"help")) { printf("\nPDF layer options:\n"); printf("breakonwarning=0/1 Abort conversion if graphic objects are found which\n"); printf(" are not 100%% supported\n"); printf("transparent=0/1 Make PDF transparent (alpha background)\n"); printf("extrafontdata=0/1 Store Type3 characters and capture characters\n"); + printf("fontquality=1..100 Curve approximation quality of the fonts\n"); } } @@ -1091,12 +1097,11 @@ void GFXOutputDev::startPage(int pageNum, GfxState *state, double crop_x1, doubl this->currentpage = pageNum; double x1,y1,x2,y2; int rot = doc->getPageRotate(1); - gfxcolor_t white; + gfxcolor_t white = {255,255,255,255}; + gfxcolor_t black = {255,0,0,0}; laststate = state; gfxline_t clippath[5]; - white.r = white.g = white.b = white.a = 255; - /* state->transform(state->getX1(),state->getY1(),&x1,&y1); state->transform(state->getX2(),state->getY2(),&x2,&y2); Use CropBox, not MediaBox, as page size @@ -1419,7 +1424,7 @@ void GFXOutputDev::updateStrokeColor(GfxState *state) } -gfxfont_t* createGfxFont(GfxFont*xpdffont, FontInfo*src) +gfxfont_t* createGfxFont(GfxFont*xpdffont, FontInfo*src, double config_fontquality) { gfxfont_t*font = (gfxfont_t*)malloc(sizeof(gfxfont_t)); memset(font, 0, sizeof(gfxfont_t)); @@ -1428,7 +1433,8 @@ gfxfont_t* createGfxFont(GfxFont*xpdffont, FontInfo*src) memset(font->glyphs, 0, sizeof(gfxglyph_t)*src->num_glyphs); font->id = strdup(getFontID(xpdffont)); int t; - double quality = (INTERNAL_FONT_SIZE * 20) / src->max_size; + + double quality = (INTERNAL_FONT_SIZE * 200 / config_fontquality) / src->max_size; double scale = 1; //printf("%d glyphs\n", font->num_glyphs); font->num_glyphs = 0; @@ -1519,7 +1525,7 @@ void GFXOutputDev::updateFont(GfxState *state) gfxfont_t*font = gfxfontlist_findfont(this->gfxfontlist,id); if(!font) { - font = createGfxFont(gfxFont, current_fontinfo); + font = createGfxFont(gfxFont, current_fontinfo, this->config_fontquality); font->id = strdup(id); this->gfxfontlist = gfxfontlist_addfont(this->gfxfontlist, font); device->addfont(device, font);