-
-
Save Kennyl/406e70c9be3fd835da8a333d6a747367 to your computer and use it in GitHub Desktop.
fontmin reduce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs = require("fs"); | |
| var Fontmin = require('fontmin'); | |
| var content = fs.readFileSync('a.txt', 'utf8'); | |
| var fontmin = new Fontmin() | |
| .src('a.ttf') | |
| .use(Fontmin.glyph({ | |
| text: content, | |
| hinting: false // keep ttf hint info (fpgm, prep, cvt). default = true | |
| })) | |
| .dest('b'); | |
| fontmin.run(function (err, files) { | |
| if (err) { | |
| throw err; | |
| } | |
| console.log(files[0]); | |
| // => { contents: <Buffer 00 01 00 ...> } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir b | |
| cat *.xhtml | grep -oE '\S' | sort | uniq | awk 1 ORS='' > a.txt | |
| ls a.txt | |
| ls a.ttf | |
| ls b | |
| node a.js | |
| ls b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment