From f29d8006b1d8253c50808d6eb4941bdeb808c601 Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Thu, 25 Mar 2010 13:41:58 -0700 Subject: [PATCH] new parameter addspacechars --- lib/pdf/GFXOutputDev.cc | 5 ++++- lib/pdf/GFXOutputDev.h | 1 + lib/pdf/pdf.cc | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/pdf/GFXOutputDev.cc b/lib/pdf/GFXOutputDev.cc index dee94f9..1149088 100644 --- a/lib/pdf/GFXOutputDev.cc +++ b/lib/pdf/GFXOutputDev.cc @@ -627,6 +627,7 @@ GFXOutputDev::GFXOutputDev(InfoOutputDev*info, PDFDoc*doc) this->config_drawonlyshapes = 0; this->config_disable_polygon_conversion = 0; this->config_multiply = 1; + this->config_detectspaces = 1; this->config_linkdatafile = 0; this->page2page = 0; this->num_pages = 0; @@ -644,6 +645,8 @@ void GFXOutputDev::setParameter(const char*key, const char*value) this->config_transparent = atoi(value); } else if(!strcmp(key,"drawonlyshapes")) { this->config_drawonlyshapes = atoi(value); + } else if(!strcmp(key,"detectspaces")) { + this->config_detectspaces = atoi(value); } else if(!strcmp(key,"extrafontdata")) { this->config_extrafontdata = atoi(value); } else if(!strcmp(key,"linkdatafile")) { @@ -1453,7 +1456,7 @@ void GFXOutputDev::drawChar(GfxState *state, double x, double y, (render == RENDER_INVISIBLE)) { int space = this->current_fontinfo->space_char; - if(config_extrafontdata && space>=0 && m.m00 && !m.m01) { + if(config_extrafontdata && config_detectspaces && space>=0 && m.m00 && !m.m01) { /* space char detection */ if(last_char_gfxfont == current_gfxfont && last_char_y == m.ty && diff --git a/lib/pdf/GFXOutputDev.h b/lib/pdf/GFXOutputDev.h index 8012bba..f06dd21 100644 --- a/lib/pdf/GFXOutputDev.h +++ b/lib/pdf/GFXOutputDev.h @@ -291,6 +291,7 @@ public: int config_multiply; int config_bigchar; int config_drawonlyshapes; + int config_detectspaces; char* config_linkdatafile; double config_fontquality; }; diff --git a/lib/pdf/pdf.cc b/lib/pdf/pdf.cc index 57382c4..68fa711 100644 --- a/lib/pdf/pdf.cc +++ b/lib/pdf/pdf.cc @@ -368,6 +368,9 @@ static void pdf_setparameter(gfxsource_t*src, const char*name, const char*value) msg(" setting parameter %s to \"%s\"", name, value); if(!strncmp(name, "fontdir", strlen("fontdir"))) { addGlobalFontDir(value); + } else if(!strcmp(name, "addspacechars")) { + config_addspace = atoi(value); + gfxparams_store(i->parameters, "detectspaces", 0); } else if(!strcmp(name, "detectspaces")) { config_addspace = atoi(value); } else if(!strcmp(name, "fontquality")) { -- 1.7.10.4