diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-10-24 19:19:50 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-10-26 18:46:43 +0200 |
commit | 343abcf4dfa2d3da2bbec5e34d48c1b337a3348c (patch) | |
tree | 3068fd1dde9da9479088bc25216f78154a987cab /source/fitz | |
parent | 7025f65f92d7b7f3547324ea944080fb804083f4 (diff) | |
download | mupdf-343abcf4dfa2d3da2bbec5e34d48c1b337a3348c.tar.xz |
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.
Diffstat (limited to 'source/fitz')
-rw-r--r-- | source/fitz/stext-device.c | 5 |
1 files changed, 2 insertions, 3 deletions
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. */ } |