diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-10-24 18:10:07 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-10-24 18:45:58 +0200 |
commit | fbc45bbc784f7be294eb29b1fbae896e706571d5 (patch) | |
tree | cfe335ba7ba13eb6998296554aedb3480d87723d | |
parent | 25837ec93522939d12e7ce0efd94bfa1435e6775 (diff) | |
download | mupdf-fbc45bbc784f7be294eb29b1fbae896e706571d5.tar.xz |
Use correct coordinates for synthesized space characters in stext device.
-rw-r--r-- | source/fitz/stext-device.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/fitz/stext-device.c b/source/fitz/stext-device.c index ff26acdb..588c1454 100644 --- a/source/fitz/stext-device.c +++ b/source/fitz/stext-device.c @@ -699,21 +699,23 @@ fz_add_stext_char_imp(fz_context *ctx, fz_stext_device *dev, fz_stext_style *sty printf("%c%c append=%d space=%d size=%g spacing=%g base_offset=%g\n", dev->lastchar, c, can_append, add_space, size, spacing, base_offset); #endif - if (can_append == 0) + /* Start a new span */ + if (!can_append) { - /* Start a new span */ add_span_to_soup(ctx, dev->spans, dev->cur_span); dev->cur_span = NULL; dev->cur_span = fz_new_stext_span(ctx, &p, wmode, trm); dev->cur_span->spacing = 0; } + + /* Add synthetic space */ if (add_space) { - r.x = - 0.2f; - r.y = 0; - fz_transform_point(&r, trm); - add_char_to_span(ctx, dev->cur_span, ' ', &p, &r, style); + /* We know we always have a cur_span here */ + r = dev->cur_span->max; + add_char_to_span(ctx, dev->cur_span, ' ', &r, &p, style); } + no_glyph: add_char_to_span(ctx, dev->cur_span, c, &p, &q, style); dev->lastchar = c; |