aboutsummaryrefslogtreecommitdiff
path: root/gulpfile.js
diff options
context:
space:
mode:
authorcodecalm <codecalm@gmail.com>2021-01-21 00:41:41 +0100
committercodecalm <codecalm@gmail.com>2021-01-21 00:41:41 +0100
commitd8885360bb025bfb35df00489439d9c718f18535 (patch)
tree958dd468e01a84d1736a2bd8953745a9acd7dc8a /gulpfile.js
parentRelease 1.39.0 (diff)
downloadtabler-icons-d8885360bb025bfb35df00489439d9c718f18535.tar.xz
iconfont process optimize
Diffstat (limited to 'gulpfile.js')
-rw-r--r--gulpfile.js29
1 files changed, 20 insertions, 9 deletions
diff --git a/gulpfile.js b/gulpfile.js
index bdda07da..96b69001 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -6,6 +6,7 @@ const gulp = require('gulp'),
p = require('./package.json'),
csv = require('csv-parser'),
zip = require('gulp-zip'),
+ svgo = require('gulp-svgo'),
puppeteer = require('puppeteer'),
outlineStroke = require('svg-outline-stroke'),
iconfont = require('gulp-iconfont'),
@@ -229,15 +230,25 @@ gulp.task('iconfont-svg-outline', function (cb) {
}
}).catch(error => console.log(error));
});
+ });
- // correct svg outline directions in a child process using fontforge
- const generate = cp.spawn("fontforge", ["-lang=py", "-script", "./fix-outline.py"], { stdio: 'inherit' });
- generate.on("close", function (code) {
- console.log(`Correcting svg outline directions exited with code ${code}`);
- if (!code) {
- cb();
- }
- });
+ cb();
+});
+
+gulp.task('iconfont-optimize', function() {
+ return gulp.src('icons-outlined/*')
+ .pipe(svgo())
+ .pipe(gulp.dest('icons-outlined'));
+});
+
+gulp.task('iconfont-fix-outline', function(cb) {
+ // correct svg outline directions in a child process using fontforge
+ const generate = cp.spawn("fontforge", ["-lang=py", "-script", "./fix-outline.py"], { stdio: 'inherit' });
+ generate.on("close", function (code) {
+ console.log(`Correcting svg outline directions exited with code ${code}`);
+ if (!code) {
+ cb();
+ }
});
});
@@ -332,7 +343,7 @@ gulp.task('update-tags-unicode', function(cb) {
cb();
});
-gulp.task('build-iconfont', gulp.series('iconfont-prepare', 'iconfont-svg-outline', 'iconfont', 'iconfont-css', 'iconfont-clean', 'update-tags-unicode'));
+gulp.task('build-iconfont', gulp.series('iconfont-prepare', 'iconfont-svg-outline', 'iconfont-fix-outline', 'iconfont-optimize', 'iconfont', 'iconfont-css', 'iconfont-clean', 'update-tags-unicode'));
gulp.task('build-zip', function () {
const version = p.version;