From 253a976aa4c0993c0b685deaceefb3220a0825d1 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 26 May 2014 16:56:34 +0200 Subject: Fix 695261: separate TM and CTM in outline extraction and stroking steps. We used to extract the outline using the combined TM*CTM matrix and use the identity transform for stroking, thus ending up with the wrong line width. If we instead extract using the TM and then stroke with the CTM we get the correct results. --- source/fitz/draw-device.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c index 98b7990c..73a8b585 100644 --- a/source/fitz/draw-device.c +++ b/source/fitz/draw-device.c @@ -583,10 +583,10 @@ fz_draw_fill_text(fz_device *devp, fz_text *text, const fz_matrix *ctm, } else { - fz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &trm); + fz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &tm); if (path) { - fz_draw_fill_path(devp, path, 0, &fz_identity, colorspace, color, alpha); + fz_draw_fill_path(devp, path, 0, ctm, colorspace, color, alpha); fz_free_path(dev->ctx, path); } else @@ -646,10 +646,10 @@ fz_draw_stroke_text(fz_device *devp, fz_text *text, fz_stroke_state *stroke, } else { - fz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &trm); + fz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &tm); if (path) { - fz_draw_stroke_path(devp, path, stroke, &fz_identity, colorspace, color, alpha); + fz_draw_stroke_path(devp, path, stroke, ctm, colorspace, color, alpha); fz_free_path(dev->ctx, path); } else @@ -754,7 +754,7 @@ fz_draw_clip_text(fz_device *devp, fz_text *text, const fz_matrix *ctm, int accu } else { - fz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &trm); + fz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &tm); if (path) { fz_pixmap *old_dest; @@ -765,7 +765,7 @@ fz_draw_clip_text(fz_device *devp, fz_text *text, const fz_matrix *ctm, int accu state[1].mask = NULL; fz_try(ctx) { - fz_draw_fill_path(devp, path, 0, &fz_identity, fz_device_gray(ctx), &white, 1); + fz_draw_fill_path(devp, path, 0, ctm, fz_device_gray(ctx), &white, 1); } fz_always(ctx) { @@ -858,7 +858,7 @@ fz_draw_clip_stroke_text(fz_device *devp, fz_text *text, fz_stroke_state *stroke } else { - fz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &trm); + fz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &tm); if (path) { fz_pixmap *old_dest; @@ -870,7 +870,7 @@ fz_draw_clip_stroke_text(fz_device *devp, fz_text *text, fz_stroke_state *stroke state[0].mask = NULL; fz_try(ctx) { - fz_draw_stroke_path(devp, path, stroke, &fz_identity, fz_device_gray(ctx), &white, 1); + fz_draw_stroke_path(devp, path, stroke, ctm, fz_device_gray(ctx), &white, 1); } fz_always(ctx) { -- cgit v1.2.3