diff --git a/lib/stroke_extractor.js b/lib/stroke_extractor.js index 802ac734..9798582f 100644 --- a/lib/stroke_extractor.js +++ b/lib/stroke_extractor.js @@ -431,8 +431,16 @@ function extract_stroke(paths, endpoint_map, bridge_adjacency, log, if (self_intersecting) { log.push(['error', 'Extracted a self-intersecting stroke.']); } + var num_segments_on_path = 0; for (var index in visited) { extracted_indices[index] = true; + num_segments_on_path += 1; + } + // Single-segment strokes may be due to graphical artifacts in the font. + // We drop them to remove these artifacts. + if (num_segments_on_path === 1) { + log.push(['success', 'Dropping single-segment stroke.']); + return undefined; } return result; } else if (extracted_indices[key] || visited[key]) {