Skip to content

Commit

Permalink
ttf2woff2 -> wawoff2
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaly Puzrin committed Feb 24, 2018
1 parent ee70c58 commit 941fbf1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ rebuild:
# convert to other formats
./node_modules/.bin/svg2ttf "$(FONT_DIR)/fontello.svg" "$(FONT_DIR)/fontello.ttf"
./node_modules/.bin/ttf2woff "$(FONT_DIR)/fontello.ttf" "$(FONT_DIR)/fontello.woff"
cat "$(FONT_DIR)/fontello.ttf" | ./node_modules/.bin/ttf2woff2 >> "$(FONT_DIR)/fontello.woff2"
./node_modules/wawoff/bin/woff2_compress.js "$(FONT_DIR)/fontello.ttf" "$(FONT_DIR)/fontello.woff2"
rm "$(FONT_DIR)/fontello.ttf"
rm "$(FONT_DIR)/fontello.svg"

Expand Down
6 changes: 4 additions & 2 deletions internal/fontello/font_build/_lib/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const mz = require('mz');
const fs = require('fs');
const ttf2eot = require('ttf2eot');
const ttf2woff = require('ttf2woff');
const ttf2woff2 = require('ttf2woff2');
const wawoff2 = require('wawoff2');
const svg2ttf = require('svg2ttf');
const pug = require('pug');
const b64 = require('base64-js');
Expand Down Expand Up @@ -156,7 +156,9 @@ module.exports = async function fontWorker(taskInfo) {

// Convert TTF to WOFF2.
//
await mz.fs.writeFile(files.woff2, ttf2woff2(ttfOutput));
let woff2Output = await wawoff2.compress(ttfOutput);

await mz.fs.writeFile(files.woff2, woff2Output);


// Write template files. (generate dynamic and copy static)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"svgpath": "^2.2.1",
"ttf2eot": "^2.0.0",
"ttf2woff": "^2.0.1",
"ttf2woff2": "^2.0.3",
"wawoff2": "^1.0.0",
"typeahead.js": "0.11.1",
"uglify-js": "^3.1.10",
"uglifyify": "^4.0.5",
Expand Down

0 comments on commit 941fbf1

Please sign in to comment.