{"_id":"@akylas/fontmin","_rev":"1-f074e67dea9206156d4244d6a0d71ca8","name":"@akylas/fontmin","dist-tags":{"latest":"0.9.9"},"versions":{"0.9.9":{"name":"@akylas/fontmin","version":"0.9.9","description":"Minify font seamlessly, font subsetter, webfont (eot, woff, svg) converter.","main":"index.js","keywords":["font","webfont","icon","iconfont","font-face","compress","minify","font-cli","otf","ttf","woff","eot","svg","ttf2eot","ttf2woff","ttf2svg","svg2ttf","css","base64"],"author":{"name":"junmer"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ecomfe/fontmin.git"},"engines":{"node":">=8"},"bin":{"fontmin":"cli.js"},"scripts":{"test":"mocha","coverage":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter spec --check-leaks test/"},"dependencies":{"b3b":"0.0.1","buffer-to-vinyl":"^1.0.0","code-points":"^2.0.0-1","concat-stream":"^1.6.2","fonteditor-core":"^1.0.2","get-stdin":"^6.0.0","is-otf":"^0.1.2","is-svg":"^1.1.1","is-ttf":"^0.2.2","lodash":"^4.17.10","meow":"^3.0.0","pako":"^1.0.1","replace-ext":"0.0.1","stream-combiner":"^0.2.1","through2":"2.0.1","ttf2woff2":"3.0.0","vinyl-fs":"3.0.3"},"devDependencies":{"chai":"^4.1.2","gulp-clean":"^0.4.0","is-eot":"^1.0.0","is-woff":"^1.0.1","is-woff2":"^1.0.0","istanbul":"^0.4.3","mocha":"^6.1.4"},"gitHead":"50bdffee2c2debd3cc2d645912e09b57588ad9cc","bugs":{"url":"https://github.com/ecomfe/fontmin/issues"},"homepage":"https://github.com/ecomfe/fontmin#readme","_id":"@akylas/fontmin@0.9.9","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-BVXtdmzEfgoC2KQ6sHv7eo3Ce3+45B6/ZB9QjSqr3ZjYV7z0P7CClvbTrL/B0cFUf+gyn48qPm5mmNkitw5UsQ==","shasum":"2c0bfcaae65099b1a3e6811c4e05953d6a8ffa1e","tarball":"https://registry.npmjs.org/@akylas/fontmin/-/fontmin-0.9.9.tgz","fileCount":18,"unpackedSize":45167,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvzSLCRA9TVsSAnZWagAA/gMP+gJJEqZW+TPndZZ/UBh0\n5CqdluJAgaJtZ2NqKoysVxQZMQtkkeaYZWrmPHVwTpBSl61OBSxh5zti0+xH\n+qrkdnQiM95X1h8yvdn5TjTgsa6R03Pdcy3g/liB/M8LmoQILGx27w5Y2two\nPNXPgPRqgHvNUWO097iVCfgyut3F4aH8gx720i94XZN88fVLRBDsAI+ALYfU\nwj8shAYM511n6aSU5yUK8bEi/xdi6Ef45s6M10IR4fA29NHTbuLbQC60K8SR\ndiB1Q0izXJ0jqI3PuM/kf6yifMcL3k7+hfU14dr/KyegVz1W1jGCZ4n50Tq6\nrSbgcxjq4WrCoNtjHnjxsl/PGdHsneTxOTEteNRffLuKOX878cnYmEZt89EG\n2AoR4qOCgFjl4nziKSCMvHv+9MHHjms2qOE+arHRCt3TO61fy1Vx+dOBj3fV\nUkdCrF0KzCJB8riJ9ZZXzbfD+SmjJ2+J19bEkQ4ekrT045HisRNjDoeQCio4\nTLVHamvbGewegMwX2/LNnac25sk2NxYpno3I4bGrCFPP5RNvVv21Re3pu+7M\nxF9bvAlFFE8L9dj/uN8muUiz3ykNIWh3elQNOaoBi548++281Xyanx+KOxzC\nZ64ZS8ne1tMenNnEXqj3lueALb28vGiK2qjfNGh2VcRmULiCPy/R21aoIWH9\nWd3S\r\n=TbUa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIACKbL/4wcpF3bFRZilq855HAGNZNHt9RDsiguay9kt2AiEAnIskrYS9utXgmwGqAe1d4JFnS2i6Wj27s1PpBGkGSUQ="}]},"_npmUser":{"name":"farfromrefuge","email":"martin.guillon@akylas.fr"},"directories":{},"maintainers":[{"name":"farfromrefuge","email":"martin.guillon@akylas.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fontmin_0.9.9_1623143562885_0.9632424790306882"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-08T09:12:42.578Z","0.9.9":"2021-06-08T09:12:43.155Z","modified":"2022-04-04T12:31:50.467Z"},"maintainers":[{"name":"farfromrefuge","email":"martin.guillon@akylas.fr"}],"description":"Minify font seamlessly, font subsetter, webfont (eot, woff, svg) converter.","homepage":"https://github.com/ecomfe/fontmin#readme","keywords":["font","webfont","icon","iconfont","font-face","compress","minify","font-cli","otf","ttf","woff","eot","svg","ttf2eot","ttf2woff","ttf2svg","svg2ttf","css","base64"],"repository":{"type":"git","url":"git+https://github.com/ecomfe/fontmin.git"},"author":{"name":"junmer"},"bugs":{"url":"https://github.com/ecomfe/fontmin/issues"},"license":"MIT","readme":"\n<p align=\"center\">\n    <a href=\"http://ecomfe.github.io/fontmin/\">\n        <img height=\"128\" width=\"128\" src=\"https://raw.githubusercontent.com/ecomfe/fontmin/master/fontmin.png\">\n    </a>\n</p>\n\n# fontmin\n**Minify font seamlessly**\n\n[![NPM version][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n[![Downloads][downloads-image]][npm-url]\n[![Dependencies][dep-image]][dep-url]\n[![Font support][font-image]][font-url]\n\n## Homepage\n\n- [简体中文](http://ecomfe.github.io/fontmin/)\n- [繁體中文](http://ecomfe.github.io/fontmin/tw)\n- [日本語](http://ecomfe.github.io/fontmin/jp)\n- [한국어](http://ecomfe.github.io/fontmin/kr)\n- [English](http://ecomfe.github.io/fontmin/en)\n\n## Install\n\n```sh\n$ npm install --save fontmin\n```\n\n## Usage\n\n```js\nvar Fontmin = require('fontmin');\n\nvar fontmin = new Fontmin()\n    .src('fonts/*.ttf')\n    .dest('build/fonts');\n\nfontmin.run(function (err, files) {\n    if (err) {\n        throw err;\n    }\n\n    console.log(files[0]);\n    // => { contents: <Buffer 00 01 00 ...> }\n});\n```\n\nYou can use [gulp-rename](https://github.com/hparra/gulp-rename) to rename your files:\n\n```js\nvar Fontmin = require('fontmin');\nvar rename = require('gulp-rename');\n\nvar fontmin = new Fontmin()\n    .src('fonts/big.ttf')\n    .use(rename('small.ttf'));\n```\n\n## API\n\n### new Fontmin()\n\nCreates a new `Fontmin` instance.\n\n### .src(file)\n\nType: `Array|Buffer|String`\n\nSet the files to be optimized. Takes a buffer, glob string or an array of glob strings\nas argument.\n\n### .dest(folder)\n\nType: `String`\n\nSet the destination folder to where your files will be written. If you don't set\nany destination no files will be written.\n\n### .use(plugin)\n\nType: `Function`\n\nAdd a `plugin` to the middleware stack.\n\n### .run(cb)\n\nType: `Function`\n\nOptimize your files with the given settings.\n\n#### cb(err, files, stream)\n\nThe callback will return an array of vinyl files in `files` and a Readable/Writable\nstream in `stream`\n\n## Plugins\n\nThe following plugins are bundled with fontmin:\n\n* [glyph](#glyph) — Compress ttf by glyph.\n* [ttf2eot](#ttf2eot) — Convert ttf to eot.\n* [ttf2woff](#ttf2woff) — Convert ttf to woff.\n* [ttf2svg](#ttf2svg) — Convert ttf to svg.\n* [css](#css) — Generate css from ttf, often used to make iconfont.\n* [svg2ttf](#svg2ttf) — Convert font format svg to ttf.\n* [svgs2ttf](#svgs2ttf) — Concat svg files to a ttf, just like css sprite.\n* [otf2ttf](#otf2ttf) — Convert otf to ttf.\n\n### .glyph()\n\nCompress ttf by glyph.\n\n```js\nvar Fontmin = require('fontmin');\n\nvar fontmin = new Fontmin()\n    .use(Fontmin.glyph({ \n        text: '天地玄黄 宇宙洪荒',\n        hinting: false         // keep ttf hint info (fpgm, prep, cvt). default = true\n    }));\n```\n\n### .ttf2eot()\n\nConvert ttf to eot.\n\n```js\nvar Fontmin = require('fontmin');\n\nvar fontmin = new Fontmin()\n    .use(Fontmin.ttf2eot());\n```\n\n### .ttf2woff()\n\nConvert ttf to woff.\n\n```js\nvar Fontmin = require('fontmin');\n\nvar fontmin = new Fontmin()\n    .use(Fontmin.ttf2woff({\n        deflate: true           // deflate woff. default = false\n    }));\n```\n\n### .ttf2svg()\n\nConvert ttf to svg.\n\nyou can use [imagemin-svgo](https://github.com/imagemin/imagemin-svgo) to compress svg:\n\n```js\nvar Fontmin = require('fontmin');\nvar svgo = require('imagemin-svgo');\n\nvar fontmin = new Fontmin()\n    .use(Fontmin.ttf2svg())\n    .use(svgo());\n\n```\n\n### .css()\n\nGenerate css from ttf, often used to make iconfont.\n\n```js\nvar Fontmin = require('fontmin');\n\nvar fontmin = new Fontmin()\n    .use(Fontmin.css({\n        fontPath: './',         // location of font file \n        base64: true,           // inject base64 data:application/x-font-ttf; (gzip font with css). \n                                // default = false\n        glyph: true,            // generate class for each glyph. default = false\n        iconPrefix: 'my-icon',  // class prefix, only work when glyph is `true`. default to \"icon\"\n        fontFamily: 'myfont',   // custom fontFamily, default to filename or get from analysed ttf file\n        asFileName: false,      // rewrite fontFamily as filename force. default = false\n        local: true             // boolean to add local font. default = false\n    }));\n```\n\nAlternatively, a transform function can be passed as `fontFamily` option.\n```js\nvar Fontmin = require('fontmin');\n\nvar fontmin = new Fontmin()\n    .use(Fontmin.css({\n        // ...\n        fontFamily: function(fontInfo, ttf) {\n          return \"Transformed Font Family Name\"\n        },\n        // ...\n    }));\n```\n\n### .svg2ttf()\n\nConvert font format svg to ttf.\n\n```js\nvar Fontmin = require('fontmin');\n\nvar fontmin = new Fontmin()\n    .src('font.svg')\n    .use(Fontmin.svg2ttf());\n```\n\n### .svgs2ttf()\n\nConcat svg files to a ttf, just like css sprite.\n\nawesome work with [css](#css) plugin:\n\n```js\nvar Fontmin = require('fontmin');\n\nvar fontmin = new Fontmin()\n    .src('svgs/*.svg')\n    .use(Fontmin.svgs2ttf('font.ttf', {fontName: 'iconfont'}))\n    .use(Fontmin.css({\n        glyph: true\n    }));\n```\n\n### .otf2ttf()\n\nConvert otf to ttf.\n\n```js\nvar Fontmin = require('fontmin');\n\nvar fontmin = new Fontmin()\n    .src('fonts/*.otf')\n    .use(Fontmin.otf2ttf());\n```\n\n## CLI\n\n```bash\n$ npm install -g fontmin\n```\n\n```sh\n$ fontmin --help\n\n  Usage\n    $ fontmin <file> [<output>]\n    $ fontmin <directory> [<output>]\n    $ fontmin <file> > <output>\n    $ cat <file> | fontmin > <output>\n\n  Example\n    $ fontmin fonts/* build\n    $ fontmin fonts build\n    $ fontmin foo.ttf > foo-optimized.ttf\n    $ cat foo.ttf | fontmin > foo-optimized.ttf\n\n  Options\n    -t, --text                          require glyphs by text\n    -b, --basic-text                    require glyphs with base chars\n    -d, --deflate-woff                  deflate woff\n    --font-family                       font-family for @font-face CSS\n    --css-glyph                         generate class for each glyf. default = false\n    -T, --show-time                     show time fontmin cost\n```\n\nyou can use `curl` to generate font for websites running on PHP, ASP, Rails and more:\n\n```sh\n$ text=`curl www.baidu.com` && fontmin -t \"$text\" font.ttf\n```\nor you can use [html-to-text](https://www.npmjs.com/package/html-to-text) to make it smaller:\n\n```sh\n$ npm install -g html-to-text\n$ text=`curl www.baidu.com | html-to-text` && fontmin -t \"$text\" font.ttf\n```\n\nwhat is more, you can use [phantom-fetch-cli](https://www.npmjs.com/package/phantom-fetch-cli) to generate font for `SPA` running JS template:\n\n```sh\n$ npm install -g phantom-fetch-cli\n$ text=`phantom-fetch http://www.chinaw3c.org` && fontmin -t \"$text\" font.ttf\n```\n\n## Related\n\n- [fontmin-app](https://github.com/ecomfe/fontmin-app)\n- [gulp-fontmin](https://github.com/ecomfe/gulp-fontmin)\n- [fonteditor](https://github.com/ecomfe/fonteditor)\n\n## Thanks\n\n- [imagemin](https://github.com/imagemin/imagemin)\n- [free chinese font](http://zenozeng.github.io/Free-Chinese-Fonts/)\n- [浙江民间书刻体][font-url]\n\n## License\n\nMIT © [fontmin](https://raw.githubusercontent.com/ecomfe/fontmin/master/LICENSE)\n\n\n[downloads-image]: http://img.shields.io/npm/dm/fontmin.svg\n[npm-url]: https://npmjs.org/package/fontmin\n[npm-image]: http://img.shields.io/npm/v/fontmin.svg\n\n[travis-url]: https://travis-ci.org/ecomfe/fontmin\n[travis-image]: http://img.shields.io/travis/ecomfe/fontmin.svg\n\n[dep-url]: https://david-dm.org/ecomfe/fontmin\n[dep-image]: http://img.shields.io/david/ecomfe/fontmin.svg\n\n[font-image]: https://img.shields.io/badge/font-eonway-blue.svg\n[font-url]: http://weibo.com/eonway\n","readmeFilename":"README.md"}