{"_id":"@alioth_91/fantasticon","_rev":"1-caf8a3e1312d87ec405b80dbe8c153c6","name":"@alioth_91/fantasticon","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@alioth_91/fantasticon","version":"1.0.0","description":"Icon font generation tool","repository":{"type":"git","url":"git+https://github.com/tancredi/fantasticon.git"},"keywords":["icons","fonts","iconfonts","svg","vector"],"author":{"name":"Tancredi Trugenberger"},"bugs":{"url":"https://github.com/tancredi/fantasticon/issues"},"homepage":"https://github.com/tancredi/fantasticon#readme","main":"lib/index.js","bin":{"fantasticon":"bin/fantasticon"},"license":"MIT","scripts":{"test":"jest","build":"rimraf lib && tsc --project ./tsconfig.json","watch":"npm run build -- --watch","typecheck":"tsc --noEmit --project tsconfig.test.json --noEmit","lint":"prettier --check ."},"prepublish":"build","dependencies":{"change-case":"^4.1.2","cli-color":"^2.0.0","commander":"^7.2.0","glob":"^7.2.0","handlebars":"^4.7.7","slugify":"^1.6.0","svg2ttf":"^6.0.3","svgicons2svgfont":"^10.0.3","ttf2eot":"^2.0.0","ttf2woff":"^3.0.0","ttf2woff2":"^4.0.4"},"devDependencies":{"@types/cli-color":"^2.0.0","@types/glob":"^7.1.3","@types/jest":"^27.0.2","@types/node":"^16.10.2","@types/svg2ttf":"^5.0.1","@types/svgicons2svgfont":"^10.0.1","@types/ttf2eot":"^2.0.0","@types/ttf2woff":"^2.0.2","@types/ttf2woff2":"^2.0.0","jest":"^26.6.3","prettier":"^2.4.1","rimraf":"^3.0.2","semantic-release":"^18.0.0","ts-jest":"^26.5.6","typescript":"^4.4.3"},"jest":{"preset":"ts-jest","testEnvironment":"node","rootDir":"./src","globals":{"ts-jest":{"tsconfig":"./tsconfig.test.json"}}},"engines":{"node":">= 10.0.0"},"gitHead":"d7ec1f7d121db2c21b7671668cd68c9a306720f2","_id":"@alioth_91/fantasticon@1.0.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-kFKc9EcBZKjgDXGHC9iwGxXm//WJy4ArGuirFq4BXV/P6yBWCYXJDRklPksL29hiohpvYIW7fXivqJEMyjWUgQ==","shasum":"f6e62fd564d3f81cf7b5902b5346d406803a34cb","tarball":"https://registry.npmjs.org/@alioth_91/fantasticon/-/fantasticon-1.0.0.tgz","fileCount":119,"unpackedSize":111256,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBBliKJsEjrOJqgMI0i6kjvSHE9iOG+xsGj/iTJekeo3AiEAuXC3dl7PmAfsq7GoXUdePC0kVCLf3tfHnuy+/soDrss="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjaos6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpfLw/7B3zGXBBGJrI/j/SNh8vylcCZzr9z+2xI/3mKdK2+EMvfW8Fw\r\nJ4f0HklG8EX6NHFuu9/eP3uEIEEw1N0Xazn5/88FqenXzEkWKfqs7eBwXUGB\r\nAkgQE+5W77SwARIlgkWPvsy24442Qsx8iSaSW8mDeLKEfnRjRrhL6SUt4qxz\r\n4lOv31ffFalT/INwg5MJA1YHWADTZR12rYeEXQKIXsuPv7TCwviSWSr66RXn\r\nmhTpHCYyH43q3ShVRE7YAVYbxmaBt3NGLvs0eAvINOoIu+fLZiqouWp7WcVE\r\nvjsAcdxlb8KO6hoJ16xY4JKv80GhU4brgj8UF5Nd5W15HRxWLx6Ui+N+TvBu\r\noqEbSUkEvgl97/8sc9EoeXh4DWJDS6v/RQzZMGAqdWAE54tt8Av0kSqKE3Ls\r\nWek6c/DjgvnOCTGnONBCWq929yMy5qCnBHitmIiiRTMNlTJHmuT40aTFN5cK\r\nSoMAUQKLwCwpcdZ/pKtqgNUuZ67QWaRJlepL8xCMvZ70xFtjd4B1mI10DJS8\r\nw6lYCxklEeoc7Gqtzn3vM/n4W9hJtr4EEBZKFMJrR3UDuwfNNTEaurb0BIMP\r\n0yqSUMkinQuVQBLIBkh5ycXSDb2rASD+cvoRsWutCT6UPX+6uBGyoNVkAXr7\r\nyFpgGBVtSOPu3sfjp2rQnY5MOYRo/07Ipyg=\r\n=K9o9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"alioth_91","email":"z610886764@163.com"},"directories":{},"maintainers":[{"name":"alioth_91","email":"z610886764@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fantasticon_1.0.0_1667926842391_0.7412454132360875"},"_hasShrinkwrap":false},"1.0.1":{"name":"@alioth_91/fantasticon","version":"1.0.1","description":"Icon font generation tool","repository":{"type":"git","url":"git+https://github.com/Alioth1017/fantasticon.git"},"keywords":["icons","fonts","iconfonts","svg","vector"],"author":{"name":"Tancredi Trugenberger"},"bugs":{"url":"https://github.com/Alioth1017/fantasticon/issues"},"homepage":"https://github.com/Alioth1017/fantasticon#readme","main":"lib/index.js","bin":{"fantasticon":"bin/fantasticon"},"license":"MIT","scripts":{"test":"jest","build":"rimraf lib && tsc --project ./tsconfig.json","watch":"npm run build -- --watch","typecheck":"tsc --noEmit --project tsconfig.test.json --noEmit","lint":"prettier --check ."},"prepublish":"build","dependencies":{"change-case":"^4.1.2","cli-color":"^2.0.0","commander":"^7.2.0","glob":"^7.2.0","handlebars":"^4.7.7","slugify":"^1.6.0","svg2ttf":"^6.0.3","svgicons2svgfont":"^10.0.3","ttf2eot":"^2.0.0","ttf2woff":"^3.0.0","ttf2woff2":"^4.0.4"},"devDependencies":{"@types/cli-color":"^2.0.0","@types/glob":"^7.1.3","@types/jest":"^27.0.2","@types/node":"^16.10.2","@types/svg2ttf":"^5.0.1","@types/svgicons2svgfont":"^10.0.1","@types/ttf2eot":"^2.0.0","@types/ttf2woff":"^2.0.2","@types/ttf2woff2":"^2.0.0","jest":"^26.6.3","prettier":"^2.4.1","rimraf":"^3.0.2","semantic-release":"^18.0.0","ts-jest":"^26.5.6","typescript":"^4.4.3"},"jest":{"preset":"ts-jest","testEnvironment":"node","rootDir":"./src","globals":{"ts-jest":{"tsconfig":"./tsconfig.test.json"}}},"engines":{"node":">= 10.0.0"},"gitHead":"d7ec1f7d121db2c21b7671668cd68c9a306720f2","_id":"@alioth_91/fantasticon@1.0.1","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-15fVTGdirwUQ9NxetBwmct5gTU/pLX1V1gb5OhNeq/FBidGIRUPykBS9y3BcbHdlP8YtWrb+gRLSqwaCwuxUEQ==","shasum":"adbb6745a6df2fc54e25cd4538d9e0831a33d624","tarball":"https://registry.npmjs.org/@alioth_91/fantasticon/-/fantasticon-1.0.1.tgz","fileCount":119,"unpackedSize":111262,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGdrUqpt8xRmt+aXrVv36NT98KzqoOa9Ia1s0X798KlgIgMEqgRYkjVx468LQTf28vHD4eRVaGdLM9GHjLGVR+knE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjao8LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVLw//R2vXKB6Oid4rKv/T0JjtGsl+SxGC9WPRJ/P4i2pQhmrL+aFw\r\nw+A7gZk69gttEHV54ljr36Wu2qcfcKWNpfePrIq73CEqnmHJd7M7n+jX28C6\r\n7mwP3qKEgYWsUGjRIU2u+xj/XV7vn3tvjBMHA8zul2wxmTRKIwsnnCdBVHMr\r\nLba3I8i4yuOCr/TbJ4wh6GTxpw1fcm78pdpfA7rv3qGjKXGLFrDjNXm7YZkt\r\n1GhAb6ma9b6K2qLn+2QHx3AwtNlFFV7mPifCJXkZ9NJVehhX257eTKymgrke\r\nZlH+f0nJCtWd3oAx2RKaB80tm2QZNl6hBTYJ090Q/dbaBhvjyXr+M/9nsRGf\r\nmAbzm23R7QpCmBirDYFxcPHDrJ5C87rDLS0JsdmuWv7JIBjLvtHdIPO6v+PP\r\nT+/4BlhlT2bk7Yfc9HQrQDFmaRu9u1JSqeQR5WjFpHlN0sMjTmTTk53XP/F1\r\naM2K+v7MyBquhsYuXo3NQElfdGrm16WMFWh0i15LCa4cql8DgUp7sFBgqpM7\r\neSePTDFkWrkKN1oxL8jBGio7wE+voPzMoNdIWBQ+B76vPqBjLdUjiUvCwsK1\r\naWsqL6sYCO9sY/HfhMBmg1hn9/+imhAlA5pIYjJVkfsU95uaLZILT9OqSk3W\r\nKZjveUlHqYlsVvTBFBLh2+vyxxYMxYMqL9c=\r\n=Xmzm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"alioth_91","email":"z610886764@163.com"},"directories":{},"maintainers":[{"name":"alioth_91","email":"z610886764@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fantasticon_1.0.1_1667927819304_0.40619942252892804"},"_hasShrinkwrap":false}},"time":{"created":"2022-11-08T17:00:42.293Z","1.0.0":"2022-11-08T17:00:42.588Z","modified":"2022-11-08T17:16:59.488Z","1.0.1":"2022-11-08T17:16:59.418Z"},"maintainers":[{"name":"alioth_91","email":"z610886764@163.com"}],"description":"Icon font generation tool","homepage":"https://github.com/Alioth1017/fantasticon#readme","keywords":["icons","fonts","iconfonts","svg","vector"],"repository":{"type":"git","url":"git+https://github.com/Alioth1017/fantasticon.git"},"author":{"name":"Tancredi Trugenberger"},"bugs":{"url":"https://github.com/Alioth1017/fantasticon/issues"},"license":"MIT","readme":"![Logo](https://fantasticon.s3.eu-west-2.amazonaws.com/readme/logo.png)\n\n<h2 align=\"center\">Fantasticon</h2>\n\n![Screenshot](https://fantasticon.s3.eu-west-2.amazonaws.com/readme/screenshot.png)\n\n<blockquote align=\"center\">\nFork of <a href=\"https://github.com/tancredi/fantasticon\">fantasticon@1.2.3</a> that Easy-to-use, pre-configured CLI tool to generate web-font icon kits from SVG files\n</blockquote>\n\n<p align=\"center\">\n  <img src=\"https://github.com/tancredi/fantasticon/workflows/Test/badge.svg\" alt=\"Test status\">\n  <img src=\"https://github.com/tancredi/fantasticon/workflows/Release/badge.svg\" alt=\"Release status\">\n</p>\n\n### Intro\n\nIcon-font generation, easy to use and highly configurable.\n\nIt also generates TypeScript types, JSON maps of the generated code-points, allowing for a great deal of different usages, e.g. integrating with React type-safe icon components or integration on mobile apps by just combining TTF and JSON generation.\n\n### Install\n\n```bash\nnpm install -g @alioth_91/fantasticon\n```\n\n## Use\n\n### Quick usage\n\n```bash\nfantasticon my-icons -o icon-dist\n```\n\n### Command-line\n\n**Note:** Not all options can be specified through the command line - for `formatOptions`, `pathOptions`, `getIconId` and `templates` use a [configuration file](#configuration-file) or the JavaScript [API](#api).\n\n```\nUsage: fantasticon [options] [input-dir]\n\nOptions:\n  -V, --version                output the version number\n  -c, --config <value>         custom config path (default: .fantasticonrc | fantasticonrc | .fantasticonrc.json | fantasticonrc.json | .fantasticonrc.js | fantasticonrc.js)\n  -o, --output <value>         specify output directory\n  -n, --name <value>           base name of the font set used both as default asset name (default: icons)\n  -t, --font-types <value...>  specify font formats to generate (default: eot, woff2, woff, available: eot, woff2, woff, ttf, svg)\n  -g --asset-types <value...>  specify other asset types to generate (default: css, html, json, ts, available: css, scss, sass, html, json, ts)\n  -h, --font-height <value>    the output font height (icons will be scaled so the highest has this height) (default: 300)\n  --descent <value>            the font descent\n  --normalize [bool]           normalize icons by scaling them to the height of the highest icon\n  -r, --round [bool]           setup the SVG path rounding [10e12]\n  --selector <value>           use a CSS selector instead of 'tag + prefix' (default: null)\n  -p, --prefix <value>         CSS class prefix (default: icon)\n  --tag <value>                CSS base tag for icons (default: i)\n  -u, --fonts-url <value>      public URL to the fonts directory (used in the generated CSS)\n  --debug                      display errors stack trace (default: false)\n  --silent                     run with no logs (default: false)\n  --help                       display help for command\n```\n\n### Configuration file\n\nSome options (specifically, `formatOptions`, `pathOptions` and `getIconId`) cannot be passed to the CLI directly.\n\nTo have more control and better readability, you can create a simple configuration file.\n\nBy default, `fantasticon` will look for one of following files in the working directory:\n\n```\n.fantasticonrc | fantasticonrc | .fantasticonrc.json | fantasticonrc.json | .fantasticonrc.js | fantasticonrc.js\n```\n\nYou can specify a custom `--config` option with your configuration file path.\n\nHere's an example `.fantasticonrc.js`:\n\n```js\nmodule.exports = {\n  inputDir: './icons', // (required)\n  outputDir: './dist', // (required)\n  fontTypes: ['ttf', 'woff', 'woff2'],\n  assetTypes: ['ts', 'css', 'json', 'html'],\n  fontsUrl: '/static/fonts',\n  formatOptions: {\n    // Pass options directly to `svgicons2svgfont`\n    woff: {\n      // Woff Extended Metadata Block - see https://www.w3.org/TR/WOFF/#Metadata\n      metadata: '...'\n    },\n    json: {\n      // render the JSON human readable with two spaces indentation (default is none, so minified)\n      indent: 2\n    },\n    ts: {\n      // select what kind of types you want to generate (default `['enum', 'constant', 'literalId', 'literalKey']`)\n      types: ['constant', 'literalId'],\n      // render the types with `'` instead of `\"` (default is `\"`)\n      singleQuotes: true\n    }\n  },\n  // Use a custom Handlebars template\n  templates: {\n    css: './my-custom-tp.css.hbs'\n  },\n  pathOptions: {\n    ts: './src/types/icon-types.ts',\n    json: './misc/icon-codepoints.json'\n  },\n  codepoints: {\n    'chevron-left': 57344, // decimal representation of 0xe000\n    'chevron-right': 57345,\n    'thumbs-up': 57358,\n    'thumbs-down': 57359\n  },\n  // Customize generated icon IDs (unavailable with `.json` config file)\n  getIconId: ({\n    basename, // `string` - Example: 'foo';\n    relativeDirPath, // `string` - Example: 'sub/dir/foo.svg'\n    absoluteFilePath, // `string` - Example: '/var/icons/sub/dir/foo.svg'\n    relativeFilePath, // `string` - Example: 'foo.svg'\n    index // `number` - Example: `0`\n  }) => [index, basename].join('_') // '0_foo'\n};\n```\n\n### API\n\n#### Simple usage\n\n```js\nimport { generateFonts } from '@alioth_91/fantasticon';\n\ngenerateFonts().then(results => console.log('Done', results));\n```\n\n#### Options\n\n```js\nimport { generateFonts } from '@alioth_91/fantasticon';\n\ngenerateFonts({\n  name: 'icons',\n  fontTypes: [FontAssetType.EOT, FontAssetType.WOFF2, FontAssetType.WOFF],\n  assetTypes: [\n    OtherAssetType.CSS,\n    OtherAssetType.HTML,\n    OtherAssetType.JSON,\n    OtherAssetType.TS\n  ],\n  formatOptions: { json: { indent: 2 } },\n  templates: {},\n  pathOptions: {},\n  codepoints: {},\n  fontHeight: 300,\n  round: undefined, // --\n  descent: undefined, // Will use `svgicons2svgfont` defaults\n  normalize: undefined, // --\n  selector: null,\n  tag: 'i',\n  prefix: 'icon',\n  fontsUrl: null\n}).then(results => console.log(results));\n```\n\n#### Organising icons\n\nIcon names and className will be generated from a slug of the relative path + basename of each `.svg` file found in the input directory.\n\nThis allows arranging your icons in namespaces, which can be useful if a project uses a large number of icons.\n\nConsidering the following `./icons` input directory:\n\n```\nicons\n├── logo.svg\n├── social\n│   ├── facebook.svg\n│   └── twitter.svg\n└── symbol\n    └── chevron\n        ├── left.svg\n        └── right.svg\n```\n\nRunning `fantasticon ./icons -o dist` will generate a font-set with the following Icon IDs / CSS selectors:\nAnd the generated icon IDs would be:\n\n| Icon ID                | CSS selector                 |\n| ---------------------- | ---------------------------- |\n| `social-facebook`      | `.icon.icon-social-facebook` |\n| `social-twitter`       | `.icon.icon-social-twitter`  |\n| `symbol-chevron-left`  | `.icon.icon-chevron-left`    |\n| `symbol-chevron-right` | `.icon.icon-chevron-right`   |\n\nYou can provide a `getIconId` function via the configuration file to customize how the icon IDs / CSS selectors are derived from the filepath. The function will receive relative paths to the icon and the input directory as arguments, and must return a unique string to be used as the ID.\n\n### Contribute\n\nPRs are always welcome. If you need help questions, want to bounce ideas or just say hi, [join the Discord channel](https://discord.gg/BXAY3Kc3mp).\n\n### License\n\nCopyright (c) 2020 Tancredi Trugenberger. - Released under the [MIT license](https://github.com/tancredi/fantasticon/blob/master/LICENSE)\n","readmeFilename":"README.md"}