Comments (3)
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/'));
});
from gulp-fontmin.
I had the same problem, except I only wanted ttf
files. A quick and dirty fix is to go to node_modules/gulp-fontmin/index.js
and change this:
var fontmin = new Fontmin()
.src(file.contents)
.use(rename({
path: file.path
}))
.use(Fontmin.glyph(opts))
.use(Fontmin.ttf2eot())
.use(Fontmin.ttf2woff())
.use(Fontmin.ttf2svg())
.use(Fontmin.css(opts));
to this:
var fontmin = new Fontmin()
.src(file.contents)
.use(rename({
path: file.path
}))
// .use(Fontmin.glyph(opts))
// .use(Fontmin.ttf2eot())
.use(Fontmin.ttf2woff());
// .use(Fontmin.ttf2svg())
// .use(Fontmin.css(opts));
It's on line 92 in version 0.7.3
.
Note that this is only a temporary fix, as it will be undone when you upgrade/reinstall your node_modules
. A more permanent fix would involve @junmer adding the ability to pass the output types you need as a parameter to gulp-fontmin
.
Hope this helps.
from gulp-fontmin.
what would be good about this is it would allow passing deflate: true
for ttf2woff
from gulp-fontmin.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-fontmin.