summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-03-08 14:13:07 +0100
committerTor Andersson <tor.andersson@artifex.com>2017-03-15 09:47:01 +0100
commite310747e00e9146d7ca36e5af9d168438c72d280 (patch)
treecec458303e2e3ff0dfedc7ebb1ef5f1e9ade4d13 /source/fitz
parentd7a849bef3cb481060103fe444b62cdab5b0d274 (diff)
downloadmupdf-e310747e00e9146d7ca36e5af9d168438c72d280.tar.xz
svgwrite: Fix pen advance for ligatures.
harfbuzz puts all ligature component characters at the same coordinate as the glyph.
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/svg-device.c17
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);
}
}