JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 29995
  • Score
    100M100P100Q157052F
  • License MIT

Create a WOFF2 font from a TTF font

Package Exports

  • gulp-ttf2woff2
  • gulp-ttf2woff2/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gulp-ttf2woff2) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gulp-ttf2woff2

Create a WOFF2 font from a TTF font

GitHub license

Usage

First, install gulp-ttf2woff2 as a development dependency:

npm install --save-dev gulp-ttf2woff2

Then, add it to your gulpfile.js:

import ttf2woff2 from 'gulp-ttf2woff2';

gulp.task('ttf2woff2', () => {
  gulp
    .src(['fonts/*.ttf'], {
      encoding: false, // Important!
      removeBOM: false,
    })
    .pipe(ttf2woff2())
    .pipe(gulp.dest('fonts/'));
});

API

ttf2woff(options)

options.ignoreExt

Type: Boolean Default value: false

Set to true to also convert files that doesn't have the .ttf extension.

options.clone

Type: Boolean Default value: false

Set to true to clone the file before converting him so that it will output the original file too.

Note

You may look after a full Gulp web font workflow, see gulp-iconfont fot that matter.

Contributing / Issues

Please submit TTF to WOFF2 related issues to the ttf2woff2 project on which gulp-ttf2woff2 is built.

This repository issues is only for gulp and gulp tasks related issues.

You may want to contribute to this project, pull requests are welcome if you accept to publish under the MIT license.

Authors

License

MIT