UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

22 lines (21 loc) 600 B
"use strict"; export function shapesFromFont(shapes) { return shapes == null ? void 0 : shapes.map((shapes2) => _shapesForLetter(shapes2)); } function _shapesForLetter(shapes) { const newShapes = [...shapes]; if (shapes) { for (let i = 0; i < shapes.length; i++) { const shape = shapes[i]; const holeShapes = []; if (shape.holes && shape.holes.length > 0) { for (let j = 0; j < shape.holes.length; j++) { const hole = shape.holes[j]; holeShapes.push(hole); } } newShapes.push(...holeShapes); } } return newShapes; }