From 011d9904a7022d8a6c58121f0d5ee5287193af96 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 28 May 2021 01:34:09 +0200 Subject: [PATCH] fix bug in text utils --- src/utils/textUtils.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/utils/textUtils.js b/src/utils/textUtils.js index 610890e..cd20c9c 100644 --- a/src/utils/textUtils.js +++ b/src/utils/textUtils.js @@ -1,6 +1,5 @@ import { SHAPE_CACHE_LIMIT } from '../constants/general.js'; import { Text } from '@doodle3d/cal'; -import { POTRACE_OPTIONS } from '../constants/d2Constants.js'; import * as POTRACE from '@doodle3d/potrace-js'; import ClipperShape from '@doodle3d/clipper-js'; import { shapeToVectorShape } from './vectorUtils.js'; @@ -15,7 +14,13 @@ export function createTextRaw(text, size, precision, family, style, weight) { const canvas = createTextCanvas(text, size * precision, family, style, weight); // TODO merge with potrace in flood fill trace reducer - const paths = POTRACE.getPaths(POTRACE.traceCanvas(canvas, POTRACE_OPTIONS)); + const paths = POTRACE.getPaths(POTRACE.traceCanvas(canvas, { + turnpolicy: 'black', + turdsize: 5.0, + optcurve: false, + alphamax: 0.5, + opttolerance: 0.2 + })); const pathsOffset = paths.map(path => path.map(({ x, y }) => ({ x: (x - MARGIN) / precision,