/** Convert a bitmap's horizontal ink runs to exact, integer-aligned SVG cells. * @param {string[]} rows */ export const bitmapPath = (rows) => rows .flatMap((row, y) => [...row.matchAll(/#+/g)].map( ({ index, 0: run }) => `M${index} ${y}h${run.length}v1H${index}Z`, ), ) .join('');