From 343abcf4dfa2d3da2bbec5e34d48c1b337a3348c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 24 Oct 2016 19:19:50 +0200 Subject: Change space detection heuristic. Reduce the amount of extra space required to insert a synthetic space character, but check the sign so we only trigger on extra space, never on reduced space. --- source/fitz/stext-device.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source/fitz') diff --git a/source/fitz/stext-device.c b/source/fitz/stext-device.c index 4019fb24..06a06e83 100644 --- a/source/fitz/stext-device.c +++ b/source/fitz/stext-device.c @@ -3,7 +3,7 @@ /* Extract text into an unsorted span soup. */ #define LINE_DIST 0.9f -#define SPACE_DIST 0.2f +#define SPACE_DIST 0.15f #define SPACE_MAX_DIST 0.8f #define PARAGRAPH_DIST 0.5f @@ -671,11 +671,10 @@ fz_add_stext_char_imp(fz_context *ctx, fz_stext_device *dev, fz_stext_style *sty base_offset = -ndir.y * delta.x + ndir.x * delta.y; spacing /= size * SPACE_DIST; - spacing = fabsf(spacing); if (fabsf(base_offset) < size * 0.1) { /* Only a small amount off the baseline - we'll take this */ - if (spacing < 1.0) + if (fabsf(spacing) < 1.0) { /* Motion is in line, and small. */ } -- cgit v1.2.3