From 948077de8a919a8e9e5bf695ecbb04c90f03a5c4 Mon Sep 17 00:00:00 2001 From: kekee000 Date: Sun, 26 Apr 2015 23:15:03 +0800 Subject: [PATCH] remove empty contour --- src/ttf/util/otfContours2ttfContours.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ttf/util/otfContours2ttfContours.js b/src/ttf/util/otfContours2ttfContours.js index 53b43df..7b0df94 100644 --- a/src/ttf/util/otfContours2ttfContours.js +++ b/src/ttf/util/otfContours2ttfContours.js @@ -65,7 +65,14 @@ define( } var contours = []; for (var i = 0, l = otfContours.length; i < l; i++) { - contours.push(transformContour(otfContours[i])); + + // 这里可能由于转换错误导致空轮廓,需要去除 + if (!otfContours[i][0]) { + console.warn(otfContours); + } + else { + contours.push(transformContour(otfContours[i])); + } } return contours;