From 5fdc4cbb36fdae27e0ed1453faad86cbaf44293a Mon Sep 17 00:00:00 2001 From: Duan Yao Date: Thu, 19 Jun 2014 11:06:54 +0800 Subject: [PATCH] Improve stroke handling in DrawingTracer by simulating line join. --- src/DrawingTracer.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/DrawingTracer.cc b/src/DrawingTracer.cc index c282824..66ebe8c 100644 --- a/src/DrawingTracer.cc +++ b/src/DrawingTracer.cc @@ -141,6 +141,10 @@ void DrawingTracer::stroke(GfxState * state) // 1. path steps that are not vertical or horizontal lines may still falsely "cover" many chars, // can we slice those steps further? // 2. if the line width is small, can we just ignore the path? + // 3. line join feature can't be retained. We use line-cap-square to minimize the problem that + // some chars actually covered by a line join are missed. However chars covered by a acute angle + // with line-join-miter may be still recognized as not covered. + cairo_set_line_cap(cairo, CAIRO_LINE_CAP_SQUARE); GfxPath * path = state->getPath(); for (int i = 0; i < path->getNumSubpaths(); ++i) { GfxSubpath * subpath = path->getSubpath(i);