From 0fbf0e612a263a8b8fc4b840e4941cf28133e3ba Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Sun, 18 Mar 2012 16:31:43 +1030 Subject: [PATCH 5/5] Fix text output - Decrease min char spacing. - Don't start new word if current glyph maps to 0 chars --- poppler/TextOutputDev.cc | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc index 8e9e1cf..63b7e50 100644 --- a/poppler/TextOutputDev.cc +++ b/poppler/TextOutputDev.cc @@ -126,7 +126,7 @@ // Minimum spacing between characters within a word, as a fraction of // the font size. -#define minCharSpacing -0.2 +#define minCharSpacing -0.5 // Maximum spacing between characters within a word, as a fraction of // the font size, when there is no obvious extra-wide character @@ -2397,11 +2397,11 @@ void TextPage::addChar(GfxState *state, double x, double y, } overlap = fabs(delta) < dupMaxPriDelta * curWord->fontSize && fabs(base - curWord->base) < dupMaxSecDelta * curWord->fontSize; - if (overlap || lastCharOverlap || + if (uLen > 0 && (overlap || lastCharOverlap || sp < -minDupBreakOverlap * curWord->fontSize || sp > minWordBreakSpace * curWord->fontSize || fabs(base - curWord->base) > 0.5 || - curFontSize != curWord->fontSize) { + curFontSize != curWord->fontSize)) { endWord(); } lastCharOverlap = overlap; -- 1.7.5.4