| 4519 | } |
| 4520 | |
| 4521 | function getContours(points) { |
| 4522 | var contours = []; |
| 4523 | var currentContour = []; |
| 4524 | for (var i = 0; i < points.length; i += 1) { |
| 4525 | var pt = points[i]; |
| 4526 | currentContour.push(pt); |
| 4527 | if (pt.lastPointOfContour) { |
| 4528 | contours.push(currentContour); |
| 4529 | currentContour = []; |
| 4530 | } |
| 4531 | } |
| 4532 | |
| 4533 | check.argument(currentContour.length === 0, 'There are still points left in the current contour.'); |
| 4534 | return contours; |
| 4535 | } |
| 4536 | |
| 4537 | // Convert the TrueType glyph outline to a Path. |
| 4538 | function getPath(points) { |