Skip to content

Instantly share code, notes, and snippets.

@SvenPam
Last active November 19, 2018 11:49
Show Gist options
  • Save SvenPam/78b9c4fd7faa241346d586873b83f3c8 to your computer and use it in GitHub Desktop.
Save SvenPam/78b9c4fd7faa241346d586873b83f3c8 to your computer and use it in GitHub Desktop.
Gulp Font Minification
// $ comes from using gulp-load-plugins.
gulp.task('assets:font', function () {
return gulp.src(`${paths.source.fonts}/**/*.ttf`)
.pipe($.changed('./'))
.pipe($.fontmin({
text: "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}\/~¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽž,“”‘’", //Basic Latin & Latin Extended
hinting: false,
quiet: false
}))
.pipe($.ttf2woff2())
.pipe(gulp.dest(paths.public.fonts));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment