Closed Wildhoney closed 9 years ago
Just updating the ticket:
For others who encounter this issue with read property 'contours' of undefined
:
TypeError: Cannot read property 'contours' of undefined at /Users/atimberlake/Webroot/Mobile/node_modules/gulp-fontmin/node_modules/fontmin/node_modules/fonteditor-ttf/lib/ttf/table/OS2.js:175:59
I didn't solve it, but I did have a workaround. I converted my TTF files into SVG format and stored those in the repository — as opposed to the TTF files — and then used gulp-svg2ttf
to convert the SVG files to TTF and then use fontmin
:
gulp.task('font', function() {
var upperCase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
var lowerCase = upperCase.toLowerCase();
var numbers = '0123456789';
var special = '£()+,.-@';
return gulp.src('public/fonts/PTSansWeb/*.svg')
.pipe(svg2ttf())
.pipe(fontmin({ text: [].concat(upperCase, lowerCase, numbers, special).join('') }))
.pipe(flatten())
.pipe(gulp.dest('public/fonts'));
});
Fixed with 0.9.0-alpha-3
.
I encountered this in Fontmin-app 0.2.0.
Screenshot: https://monosnap.com/file/qNnwIt9ZI0d9e6t6pMPVf3tWqpcZ6w
See issue raised on: https://github.com/ecomfe/gulp-fontmin/issues/2 :+1: