Issue #6 - Changed 'use' to override the default plugins#8
Conversation
… of augmenting them, per Issue ecomfe#6.
|
This pull request totally works. Thanks! To anybody trying to figure out how to use it: gulp.task('subset', function () {
var gulpFontmin = require('gulp-fontmin');
var Fontmin = require('fontmin');
return gulp.src('path/to/font.ttf')
.pipe(gulpFontmin({
use: [Fontmin.glyph({
text: '天地玄黄 宇宙洪荒'
})]
}))
.pipe(gulp.dest('destination/to/subset/fonts/'));
}); |
|
@junmer, This has been working without issue for me for some time, and also has a confirmation from @nikoladev. I'd love to move off |
Nope, fontmin is dead
|
|
@junmer, I don't mean to bother you, but could you please take a brief look at merging this pull request? |
specious
left a comment
There was a problem hiding this comment.
Excellent idea for the default list of fontmin plugins to take effect only when the user hasn't provided their own list. However, it would also make sense to still let the opts.chineseOnly option be applied regardless of that.
| if (text && opts.chineseOnly) { | ||
| text = text.replace(/[^\u4e00-\u9fa5]/g, ''); | ||
| } |
There was a problem hiding this comment.
It seems like opts.ChineseOnly should take effect regardless of whether custom opts.use were passed. I would consider taking this part back out of this conditional block.
The 'use' parameter now overrides the default fontmin plugins instead of augmenting them, per Issue #6.