diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2017-03-08 14:13:07 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2017-03-15 09:47:01 +0100 |
commit | e310747e00e9146d7ca36e5af9d168438c72d280 (patch) | |
tree | cec458303e2e3ff0dfedc7ebb1ef5f1e9ade4d13 | |
parent | d7a849bef3cb481060103fe444b62cdab5b0d274 (diff) | |
download | mupdf-e310747e00e9146d7ca36e5af9d168438c72d280.tar.xz |
svgwrite: Fix pen advance for ligatures.
harfbuzz puts all ligature component characters at the same coordinate
as the glyph.
-rw-r--r-- | source/fitz/svg-device.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source/fitz/svg-device.c b/source/fitz/svg-device.c index 9d42bbdf..3cae86fe 100644 --- a/source/fitz/svg-device.c +++ b/source/fitz/svg-device.c @@ -363,9 +363,20 @@ svg_dev_text_span(fz_context *ctx, svg_device *sdev, const fz_matrix *ctm, const it = &span->items[i]; if (it->ucs >= 0) { - p.x = it->x; - p.y = it->y; - fz_transform_point(&p, &inv_tm); + if (it->gid >= 0) + { + p.x = it->x; + p.y = it->y; + fz_transform_point(&p, &inv_tm); + } + else + { + /* we have no glyph (such as in a ligature) -- advance a bit */ + if (span->wmode == 0) + p.x += font_size * 0.3f; + else + p.y += font_size; + } fz_printf(ctx, out, " %g", span->wmode == 0 ? p.x : p.y); } } |