webfont 8.1.3 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,214 +4,233 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  This project adheres to [Semantic Versioning](http://semver.org).
6
6
 
7
+ ## 9.0.0 - 2019-04-19
8
+
9
+ - Changed: drops support for Node.js 6.
10
+ - Feat: improve basic templates (see [templates](templates)).
11
+ - Feat: use wasm package for generate woff2
12
+
13
+ ## 8.2.1 - 2018-12-28
14
+
15
+ - Chore: update dependencies.
16
+
17
+ ## 8.2.0 - 2018-11-13
18
+
19
+ - Added: `sort` option (and `--no-sort` flag for CLI).
20
+ - Chore: update dependencies.
21
+
22
+ ## 8.1.4 - 2018-06-05
23
+
24
+ - Chore: minimum require `svgicons2svgfont` version is now `^9.0.3` (this fix compatibility with `nodejs@10`).
25
+
7
26
  ## 8.1.3 - 2018-04-25
8
27
 
9
- * Chore: minimum require `meow` version is now `^5.0.0`.
10
- * Chore: minimum require `cosmiconfig` version is now `^5.0.3`.
11
- * Chore: minimum require `fs-extra` version is now `^6.0.1`.
12
- * Chore: drop `merge-deep` in favor `lodash.merge`.
28
+ - Chore: minimum require `meow` version is now `^5.0.0`.
29
+ - Chore: minimum require `cosmiconfig` version is now `^5.0.3`.
30
+ - Chore: minimum require `fs-extra` version is now `^6.0.1`.
31
+ - Chore: drop `merge-deep` in favor `lodash.merge`.
13
32
 
14
33
  ## 8.1.2 - 2018-04-23
15
34
 
16
- * Fixed: deterministic output (i.e. each glyph in font have same unicode in font).
35
+ - Fixed: deterministic output (i.e. each glyph in font have same unicode in font).
17
36
 
18
37
  ## 8.1.1 - 2018-03-22
19
38
 
20
- * Fixed: always configure `nunjucks` for template path.
39
+ - Fixed: always configure `nunjucks` for template path.
21
40
 
22
41
  ## 8.1.0 - 2018-03-22
23
42
 
24
- * Feat: export `config` path when he is using (in `result.config.filePath`).
43
+ - Feat: export `config` path when he is using (in `result.config.filePath`).
25
44
 
26
45
  ## 8.0.0 - 2018-03-21
27
46
 
28
- * Added: `demo` directory (thanks for [@shogo](https://github.com/ShogoFunaguchi)).
29
- * Changed: export `glyphsData` instead `foundFiles` (`glyphsData` contain all information about any glyph).
30
- * Changed: `result.styles` rename to `result.template` (for API).
31
- * Changed: `dest` by default `process.cwd()`.
32
- * Changed: rename `dest-styles` CLI option to `dest-template`.
33
- * Changed: rename `cssTemplateClassName` to `templateClassName`.
34
- * Changed: rename `cssTemplateFontPath` to `templateFontPath`.
35
- * Changed: rename `cssTemplateFontName` to `templateFontName`.
36
- * Changed: `glyphTransformFn` should always return glyph metadata.
37
- * Changed: minimum required `nodejs` version is now `6.9.5` (see [svgicons2svgfont](https://github.com/nfroidure/svgicons2svgfont/blob/master/package.json#L41).
38
- * Changed: use `globby@8` (based on `fast-glob`, it is better perf).
39
- * Chore: minimum used `svgicons2svgfont` package is now `^9.0.2`
40
- * Chore: minimum used `cosmiconfig` package is now `^4.0.0`
41
- * Fixed: don't use `globby` for getting build-in tempalte (better perf).
42
- * Fixed: always add trailing slash to `templateFontPath`.
47
+ - Added: `demo` directory (thanks for [@shogo](https://github.com/ShogoFunaguchi)).
48
+ - Changed: export `glyphsData` instead `foundFiles` (`glyphsData` contain all information about any glyph).
49
+ - Changed: `result.styles` rename to `result.template` (for API).
50
+ - Changed: `dest` by default `process.cwd()`.
51
+ - Changed: rename `dest-styles` CLI option to `dest-template`.
52
+ - Changed: rename `cssTemplateClassName` to `templateClassName`.
53
+ - Changed: rename `cssTemplateFontPath` to `templateFontPath`.
54
+ - Changed: rename `cssTemplateFontName` to `templateFontName`.
55
+ - Changed: `glyphTransformFn` should always return glyph metadata.
56
+ - Changed: minimum required `nodejs` version is now `6.9.5` (see [svgicons2svgfont](https://github.com/nfroidure/svgicons2svgfont/blob/master/package.json#L41).
57
+ - Changed: use `globby@8` (based on `fast-glob`, it is better perf).
58
+ - Chore: minimum used `svgicons2svgfont` package is now `^9.0.2`
59
+ - Chore: minimum used `cosmiconfig` package is now `^4.0.0`
60
+ - Fixed: don't use `globby` for getting build-in tempalte (better perf).
61
+ - Fixed: always add trailing slash to `templateFontPath`.
43
62
 
44
63
  ## 7.1.4 - 2017-05-24
45
64
 
46
- * Fixed: use `copyright`, `ts` and `version` with null value by default, it is avoid problems when your use long term caching.
47
- * Fixed: options for `ttf` font generation now correctly handles.
65
+ - Fixed: use `copyright`, `ts` and `version` with null value by default, it is avoid problems when your use long term caching.
66
+ - Fixed: options for `ttf` font generation now correctly handles.
48
67
 
49
68
  ## 7.1.3 - 2017-04-13
50
69
 
51
- * Fixed: search config if not present in CLI arguments.
70
+ - Fixed: search config if not present in CLI arguments.
52
71
 
53
72
  ## 7.1.2 - 2017-04-12
54
73
 
55
- * Fixed: `template` option now respected from config.
74
+ - Fixed: `template` option now respected from config.
56
75
 
57
76
  ## 7.1.1 - 2017-03-29
58
77
 
59
- * Fixed: potential crash with memory allocation when using `fs` for read files.
78
+ - Fixed: potential crash with memory allocation when using `fs` for read files.
60
79
 
61
80
  ## 7.1.0 - 2017-01-24
62
81
 
63
- * Added: `glyphTransformFn` option for transform glyph metadata before transferred in style template.
82
+ - Added: `glyphTransformFn` option for transform glyph metadata before transferred in style template.
64
83
 
65
84
  ## 7.0.2 - 2016-12-22
66
85
 
67
- * Fixed: exit code can be not number.
86
+ - Fixed: exit code can be not number.
68
87
 
69
88
  ## 7.0.1 - 2016-12-20
70
89
 
71
- * Fixed: arguments for svgicons2svgfont (missing font prefix).
72
- * Chore: improved output of help in `CLI`.
90
+ - Fixed: arguments for svgicons2svgfont (missing font prefix).
91
+ - Chore: improved output of help in `CLI`.
73
92
 
74
93
  ## 7.0.0 - 2016-11-09
75
94
 
76
- * Added: `template` option instead `css`, `cssFormat`, `srcCssTemplate`.
77
- * Added: `destStyles` options instead `destCssTemplate`.
78
- * Added: `styles` property to result.
79
- * Fixed: throw error on empty `svg` files.
80
- * Removed: `css` option.
81
- * Removed: `cssFormat` option.
82
- * Removed: `srcCssTemplate` option.
83
- * Removed: `css` property from result.
84
- * Removed: `destCssTemplate` argument from `cli`.
85
- * Tests: improved tests (relative and absolute path to template).
95
+ - Added: `template` option instead `css`, `cssFormat`, `srcCssTemplate`.
96
+ - Added: `destStyles` options instead `destCssTemplate`.
97
+ - Added: `styles` property to result.
98
+ - Fixed: throw error on empty `svg` files.
99
+ - Removed: `css` option.
100
+ - Removed: `cssFormat` option.
101
+ - Removed: `srcCssTemplate` option.
102
+ - Removed: `css` property from result.
103
+ - Removed: `destCssTemplate` argument from `cli`.
104
+ - Tests: improved tests (relative and absolute path to template).
86
105
 
87
106
  ## 6.0.4 - 2016-11-08
88
107
 
89
- * Fixed: regression bug with passed arguments to template.
108
+ - Fixed: regression bug with passed arguments to template.
90
109
 
91
110
  ## 6.0.3 - 2016-11-08
92
111
 
93
- * Fixed: validate `xml` of glyphs.
94
- * Chore: minimum required `eslint-plugin-ava` version is now `^2.2.0`.
95
- * Chore: minimum required `eslint-plugin-itgalaxy` version is now `^26.0.0`.
96
- * Chore: minimum required `eslint-plugin-jsx-a11y` version is now `^3.0.0`.
97
- * Chore: minimum required `eslint-plugin-react` version is now `^6.6.0`.
98
- * Chore: refactoring code.
112
+ - Fixed: validate `xml` of glyphs.
113
+ - Chore: minimum required `eslint-plugin-ava` version is now `^2.2.0`.
114
+ - Chore: minimum required `eslint-plugin-itgalaxy` version is now `^26.0.0`.
115
+ - Chore: minimum required `eslint-plugin-jsx-a11y` version is now `^3.0.0`.
116
+ - Chore: minimum required `eslint-plugin-react` version is now `^6.6.0`.
117
+ - Chore: refactoring code.
99
118
 
100
119
  ## 6.0.2 - 2016-11-07
101
120
 
102
- * Fixed: use `reject` instead `Promise.reject` in glyphs `error` callback.
103
- * Fixed: use callback `finish` instead `end` for `svgicons2svgfont` stream.
104
- * Tests: improve tests on bad examples.
121
+ - Fixed: use `reject` instead `Promise.reject` in glyphs `error` callback.
122
+ - Fixed: use callback `finish` instead `end` for `svgicons2svgfont` stream.
123
+ - Tests: improve tests on bad examples.
105
124
 
106
125
  ## 6.0.1 - 2016-11-07
107
126
 
108
- * Fixed: add `error` event to `glyph` stream.
109
- * Fixed: don't create `new Error` where this is not necessary.
110
- * Chore: minimum required `nunjucks` version is now `^3.0.0`.
111
- * Chore: minimum required `eslint` version is now `^3.9.1`.
112
- * Chore: minimum required `eslint-plugin-ava` version is now `^4.0.0`.
113
- * Chore: minimum required `eslint-plugin-itgalaxy` version is now `^25.0.0`.
114
- * Chore: minimum required `eslint-plugin-node` version is now `^3.0.0`.
115
- * Chore: minimum required `eslint-plugin-promise` version is now `^3.3.0`.
116
- * Chore: minimum required `eslint-plugin-react` version is now `^6.5.0`.
117
- * Tests: improve tests on bad examples.
127
+ - Fixed: add `error` event to `glyph` stream.
128
+ - Fixed: don't create `new Error` where this is not necessary.
129
+ - Chore: minimum required `nunjucks` version is now `^3.0.0`.
130
+ - Chore: minimum required `eslint` version is now `^3.9.1`.
131
+ - Chore: minimum required `eslint-plugin-ava` version is now `^4.0.0`.
132
+ - Chore: minimum required `eslint-plugin-itgalaxy` version is now `^25.0.0`.
133
+ - Chore: minimum required `eslint-plugin-node` version is now `^3.0.0`.
134
+ - Chore: minimum required `eslint-plugin-promise` version is now `^3.3.0`.
135
+ - Chore: minimum required `eslint-plugin-react` version is now `^6.5.0`.
136
+ - Tests: improve tests on bad examples.
118
137
 
119
138
  ## 6.0.0 - 2016-10-26
120
139
 
121
- * Added: support `nodejs` `7`.
122
- * Added: `verbose` argument for verbose output.
123
- * Remove: `quite` argument.
124
- * Chore: improve `README.md`.
125
- * Chore: improve `description` in `package.json`.
140
+ - Added: support `nodejs` `7`.
141
+ - Added: `verbose` argument for verbose output.
142
+ - Remove: `quite` argument.
143
+ - Chore: improve `README.md`.
144
+ - Chore: improve `description` in `package.json`.
126
145
 
127
146
  ## 5.0.0 - 2016-10-24
128
147
 
129
- * Fixed: wrong `CSS` syntax when not all format are selected.
130
- * Chore(SEMVER-MAJOR): rename extension for all templates from `nunjucks` to `njk`.
148
+ - Fixed: wrong `CSS` syntax when not all format are selected.
149
+ - Chore(SEMVER-MAJOR): rename extension for all templates from `nunjucks` to `njk`.
131
150
 
132
151
  ## 4.0.1 - 2016-10-19
133
152
 
134
- * Fixed: CLI `fontName` and `formats` arguments bug.
135
- * Chore: minimum required `ajv-cli` version is now `^1.1.0`.
136
- * Chore: minimum required `remark-preset-lint-itgalaxy` version is now `^2.0.0`.
137
- * Chore: minimum required `nunjucks` from `2.0.0` to `2.5.0`.
138
- * Chore: minimum required `eslint-plugin-import` version is now `^2.0.0`.
139
- * Chore: minimum required `eslint-plugin-promise` version is now `^3.0.0`.
140
- * Chore: minimum required `eslint-plugin-lodash` version is now `^2.1.0`.
141
- * Chore: rename `eslint-plugin-xo` to `eslint-plugin-unicorn`.
142
- * Chore: minimum required `eslint-plugin-unicorn` version is now `^1.0.0`.
143
- * Chore: minimum required `eslint-plugin-itgalaxy` version is now `^23.0.0`.
144
- * Chore: minimum required `cosmiconfig` version is now `^2.0.0`.
153
+ - Fixed: CLI `fontName` and `formats` arguments bug.
154
+ - Chore: minimum required `ajv-cli` version is now `^1.1.0`.
155
+ - Chore: minimum required `remark-preset-lint-itgalaxy` version is now `^2.0.0`.
156
+ - Chore: minimum required `nunjucks` from `2.0.0` to `2.5.0`.
157
+ - Chore: minimum required `eslint-plugin-import` version is now `^2.0.0`.
158
+ - Chore: minimum required `eslint-plugin-promise` version is now `^3.0.0`.
159
+ - Chore: minimum required `eslint-plugin-lodash` version is now `^2.1.0`.
160
+ - Chore: rename `eslint-plugin-xo` to `eslint-plugin-unicorn`.
161
+ - Chore: minimum required `eslint-plugin-unicorn` version is now `^1.0.0`.
162
+ - Chore: minimum required `eslint-plugin-itgalaxy` version is now `^23.0.0`.
163
+ - Chore: minimum required `cosmiconfig` version is now `^2.0.0`.
145
164
 
146
165
  ## 4.0.0
147
166
 
148
- * Changed: all style templates for font now have `nunjucks` extension.
149
- * Chore(package): remove extra `files` from `package.json`.
150
- * Chore(package): install all `peerDependencies` for `eslint-plugin-itgalaxy`.
151
- * Chore(package): update a minimal version `ava` from `0.15.0` to `0.16.0`.
152
- * Chore(package): update a minimal version `eslint-plugin-ava` from `2.5.0` to `3.0.0`.
153
- * Chore(package): update a minimal version `npm-run-all` from `2.3.0` to `3.0.0`.
154
- * Chore(package): update a minimal version `eslint-plugin-itgalaxy` from `8.0.0` to `11.0.0`.
155
- * Chore(package): update a minimal version `nyc` from `7.0.0` to `8.0.0`.
156
- * Chore(package): remove `nyc` settings, now fine works without their.
157
- * Chore(package): use `^` instead `~` from `babel-preset-stage-0`.
158
- * Chore(package): use `remark-preset-lint-itgalaxy` instead `remark-lint-config-itgalaxy`.
159
- * Chore(package): use right version for `eslint-plugin-*` and `eslint`.
160
- * Chore: improved `README.md`.
161
- * Chore: fix glob pattern for `lint:remark` script command.
167
+ - Changed: all style templates for font now have `nunjucks` extension.
168
+ - Chore(package): remove extra `files` from `package.json`.
169
+ - Chore(package): install all `peerDependencies` for `eslint-plugin-itgalaxy`.
170
+ - Chore(package): update a minimal version `ava` from `0.15.0` to `0.16.0`.
171
+ - Chore(package): update a minimal version `eslint-plugin-ava` from `2.5.0` to `3.0.0`.
172
+ - Chore(package): update a minimal version `npm-run-all` from `2.3.0` to `3.0.0`.
173
+ - Chore(package): update a minimal version `eslint-plugin-itgalaxy` from `8.0.0` to `11.0.0`.
174
+ - Chore(package): update a minimal version `nyc` from `7.0.0` to `8.0.0`.
175
+ - Chore(package): remove `nyc` settings, now fine works without their.
176
+ - Chore(package): use `^` instead `~` from `babel-preset-stage-0`.
177
+ - Chore(package): use `remark-preset-lint-itgalaxy` instead `remark-lint-config-itgalaxy`.
178
+ - Chore(package): use right version for `eslint-plugin-*` and `eslint`.
179
+ - Chore: improved `README.md`.
180
+ - Chore: fix glob pattern for `lint:remark` script command.
162
181
 
163
182
  ## 3.0.1
164
183
 
165
- * Fixed: `--css-template-font-path` now get also from `cosmiconfig`.
184
+ - Fixed: `--css-template-font-path` now get also from `cosmiconfig`.
166
185
 
167
186
  ## 3.0.0
168
187
 
169
- * Added: support `cosmiconfig`.
170
- * Changed: change function arguments in `standalone`.
171
- * Chore: refactoring.
172
- * Chore: sorting alphabetically `dependencies` and `devDependencies`.
173
- * Chore: remove unused `eslint-*` plugins from `devDependencies`.
174
- * Chore: update minimal version `eslint-plugin-itgalaxy` to `8.0.0`.
175
- * Chore: check is valid fonts in tests.
176
- * Chore: add more tests.
177
- * Chore: sharable config for `remark-lint`.
178
- * Chore: add `nodejs` v5 to `.travis.yml`.
188
+ - Added: support `cosmiconfig`.
189
+ - Changed: change function arguments in `standalone`.
190
+ - Chore: refactoring.
191
+ - Chore: sorting alphabetically `dependencies` and `devDependencies`.
192
+ - Chore: remove unused `eslint-*` plugins from `devDependencies`.
193
+ - Chore: update minimal version `eslint-plugin-itgalaxy` to `8.0.0`.
194
+ - Chore: check is valid fonts in tests.
195
+ - Chore: add more tests.
196
+ - Chore: sharable config for `remark-lint`.
197
+ - Chore: add `nodejs` v5 to `.travis.yml`.
179
198
 
180
199
  ## 2.0.3
181
200
 
182
- * Chore: improved `description` and `keywords` in `package.json`.
201
+ - Chore: improved `description` and `keywords` in `package.json`.
183
202
 
184
203
  ## 2.0.2
185
204
 
186
- * Fixed: `svg2ttf` now correctly generates `ttf` font.
187
- * Fixed: `ttf2eot` now correctly generates `eot` font.
188
- * Fixed: `ttf2woff` now correctly generates `woff` font.
189
- * Fixed: `svg2ttf` now correctly accepts option.
190
- * Chore: more readable name tests.
191
- * Chore: rename extension `templates`.
205
+ - Fixed: `svg2ttf` now correctly generates `ttf` font.
206
+ - Fixed: `ttf2eot` now correctly generates `eot` font.
207
+ - Fixed: `ttf2woff` now correctly generates `woff` font.
208
+ - Fixed: `svg2ttf` now correctly accepts option.
209
+ - Chore: more readable name tests.
210
+ - Chore: rename extension `templates`.
192
211
 
193
212
  ## 2.0.1
194
213
 
195
- * Chore: update `globby` to `6.0.0`.
196
- * Chore: update minimal version `babel-cli` to `6.11.0`.
197
- * Chore: update minimal version `babel-core` to `6.11.0`.
198
- * Chore: update `eslint-plugin-itgalaxy` to `6.0.0`.
214
+ - Chore: update `globby` to `6.0.0`.
215
+ - Chore: update minimal version `babel-cli` to `6.11.0`.
216
+ - Chore: update minimal version `babel-core` to `6.11.0`.
217
+ - Chore: update `eslint-plugin-itgalaxy` to `6.0.0`.
199
218
 
200
219
  ## 2.0.0
201
220
 
202
- * Added: `--src-css-template` agument.
203
- * Added: `--css-template-class-name` argument.
204
- * Added: `--css-template-font-path` argument.
205
- * Added: `--css-template-font-name` argument.
206
- * Changed: remove `--css-template-format` argument, now format is taken from `--dest-css-template`.
207
- * Changed: remove `--css` argument, css now generated if you use `--dest-css-template` argument.
208
- * Changed: rename `--css-template-dest` argument to `--dest-css-template`.
209
- * Remove: `--css-template` argument.
221
+ - Added: `--src-css-template` agument.
222
+ - Added: `--css-template-class-name` argument.
223
+ - Added: `--css-template-font-path` argument.
224
+ - Added: `--css-template-font-name` argument.
225
+ - Changed: remove `--css-template-format` argument, now format is taken from `--dest-css-template`.
226
+ - Changed: remove `--css` argument, css now generated if you use `--dest-css-template` argument.
227
+ - Changed: rename `--css-template-dest` argument to `--dest-css-template`.
228
+ - Remove: `--css-template` argument.
210
229
 
211
230
  ## 1.0.1
212
231
 
213
- * Fixed: get `fontId` from `fontName`, if `fontId` is `null` or `undefined`.
232
+ - Fixed: get `fontId` from `fontName`, if `fontId` is `null` or `undefined`.
214
233
 
215
234
  ## 1.0.0
216
235
 
217
- * Initial release.
236
+ - Initial release.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016-2018 [itgalaxy](https://itgalaxy.company)
3
+ Copyright (c) 2016-present itgalaxy inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6
6
  documentation files (the "Software"), to deal in the Software without restriction, including without limitation
package/README.md CHANGED
@@ -5,20 +5,19 @@
5
5
  [![Build status](https://ci.appveyor.com/api/projects/status/a8absovr2r44w1oc?svg=true)](https://ci.appveyor.com/project/evilebottnawi/webfont)
6
6
  [![dependencies Status](https://david-dm.org/itgalaxy/webfont/status.svg)](https://david-dm.org/itgalaxy/webfont)
7
7
  [![devDependencies Status](https://david-dm.org/itgalaxy/webfont/dev-status.svg)](https://david-dm.org/itgalaxy/webfont?type=dev)
8
- [![Greenkeeper badge](https://badges.greenkeeper.io/itgalaxy/webfont.svg)](https://greenkeeper.io)
9
8
 
10
9
  Generator of fonts from SVG icons.
11
10
 
12
11
  Features:
13
12
 
14
- * Supported font formats: `WOFF2`, `WOFF`, `EOT`, `TTF` and `SVG`.
15
- * Support configuration Files - use a `JavaScript`, `JSON` or `YAML` file to specify configuration information for an entire directory and all of its subdirectories.
16
- * Supported browsers: IE8+.
17
- * Allows to use custom templates (example `css`, `scss` and etc).
18
- * No extra dependencies as `gulp`, `grunt` or other big tools.
19
- * Tested on all platforms (`linux`, `windows` and `osx`).
20
- * CLI.
21
- * [Webpack plugin](https://github.com/itgalaxy/webfont-webpack-plugin).
13
+ - Supported font formats: `WOFF2`, `WOFF`, `EOT`, `TTF` and `SVG`.
14
+ - Support configuration Files - use a `JavaScript`, `JSON` or `YAML` file to specify configuration information for an entire directory and all of its subdirectories.
15
+ - Supported browsers: IE8+.
16
+ - Allows to use custom templates (example `css`, `scss` and etc).
17
+ - No extra dependencies as `gulp`, `grunt` or other big tools.
18
+ - Tested on all platforms (`linux`, `windows` and `osx`).
19
+ - CLI.
20
+ - [Webpack plugin](https://github.com/itgalaxy/webfont-webpack-plugin).
22
21
 
23
22
  ## Install
24
23
 
@@ -34,9 +33,15 @@ const webfont = require("webfont").default;
34
33
  webfont({
35
34
  files: "src/svg-icons/**/*.svg",
36
35
  fontName: "my-font-name"
37
- }).then(result => {
38
- console.log(result);
39
- });
36
+ })
37
+ .then(result => {
38
+ console.log(result);
39
+
40
+ return result;
41
+ })
42
+ .catch(error => {
43
+ throw error;
44
+ });
40
45
  ```
41
46
 
42
47
  Or
@@ -47,9 +52,15 @@ import webfont from "webfont";
47
52
  webfont({
48
53
  files: "src/svg-icons/**/*.svg",
49
54
  fontName: "my-font-name"
50
- }).then(result => {
51
- console.log(result);
52
- });
55
+ })
56
+ .then(result => {
57
+ console.log(result);
58
+
59
+ return result;
60
+ })
61
+ .catch(error => {
62
+ throw error;
63
+ });
53
64
  ```
54
65
 
55
66
  ## Options
@@ -118,13 +129,33 @@ If you need transform glyph metadata (e.g. titles of CSS classes) before transfe
118
129
  Example:
119
130
 
120
131
  ```js
121
- glyphTransformFn: obj => {
122
- obj.name += "_transform";
132
+ import webfont from "webfont";
123
133
 
124
- return obj;
125
- };
134
+ webfont({
135
+ files: "src/svg-icons/**/*.svg",
136
+ glyphTransformFn: obj => {
137
+ obj.name += "_transform";
138
+
139
+ return obj;
140
+ }
141
+ })
142
+ .then(result => {
143
+ console.log(result);
144
+
145
+ return result;
146
+ })
147
+ .catch(error => {
148
+ throw error;
149
+ });
126
150
  ```
127
151
 
152
+ ### `sort`
153
+
154
+ Type: `bool`
155
+ Default: `true`
156
+
157
+ Default the icons are sorted by name, do not sort by setting this to `false`
158
+
128
159
  ### `fontId`
129
160
 
130
161
  ### `fontStyle`
@@ -160,156 +191,30 @@ The interface for command-line usage is fairly simplistic at this stage, as seen
160
191
 
161
192
  `webfont --help` prints the CLI documentation.
162
193
 
163
- ### Options
164
-
165
- ```sh
166
- Generator of fonts from svg icons, svg icons to svg font, svg font to ttf, ttf to eot, ttf to woff, ttf to woff2
167
-
168
- Usage: webfont [input] [options]
169
-
170
- Input: File(s) or glob(s).
171
-
172
- If an input argument is wrapped in quotation marks, it will be passed to "fast-glob"
173
- for cross-platform glob support.
174
-
175
- Options:
176
-
177
- --config
178
-
179
- Path to a specific configuration file (JSON, YAML, or CommonJS)
180
- or the name of a module in `node_modules` that points to one.
181
- If no `--config` argument is provided, webfont will search for
182
- configuration files in the following places, in this order:
183
- - a `webfont` property in `package.json`
184
- - a `.webfontrc` file (with or without filename extension:
185
- `.json`, `.yaml`, and `.js` are available)
186
- - a `webfont.config.js` file exporting a JS object
187
- The search will begin in the working directory and move up the
188
- directory tree until a configuration file is found.
189
-
190
- -f, --font-name
191
-
192
- The font family name you want, default: "webfont".
193
-
194
- -h, --help
195
-
196
- Output usage information.
197
-
198
- -v, --version
199
-
200
- Output the version number.
201
-
202
- -r, --formats
203
-
204
- Only this formats generate.
205
-
206
- -d, --dest
207
-
208
- Destination for generated fonts.
209
-
210
- -t, --template
211
-
212
- Type of template ('css', 'scss') or path to custom template.
213
-
214
- -s, --dest-template
215
-
216
- Destination for generated template. If not passed used `dest` argument value.
217
-
218
- -c, --template-class-name
219
-
220
- Class name in css template.
221
-
222
- -p, --template-font-path
223
-
224
- Font path in css template.
225
-
226
- -n, --template-font-name
227
-
228
- Font name in css template.
229
-
230
- --verbose
231
-
232
- Tell me everything!.
233
-
234
- For "svgicons2svgfont":
235
-
236
- --font-id
237
-
238
- The font id you want, default as "--font-name".
239
-
240
- --font-style
241
-
242
- The font style you want.
243
-
244
- --font-weight
245
-
246
- The font weight you want.
247
-
248
- --fixed-width
249
-
250
- Creates a monospace font of the width of the largest input icon.
251
-
252
- --center-horizontally
253
-
254
- Calculate the bounds of a glyph and center it horizontally.
255
-
256
- --normalize
257
-
258
- Normalize icons by scaling them to the height of the highest icon.
259
-
260
- --font-height
261
-
262
- The outputted font height [MAX(icons.height)].
263
-
264
- --round
265
-
266
- Setup the SVG path rounding [10e12].
267
-
268
- --descent
269
-
270
- The font descent [0].
271
-
272
- --ascent
273
-
274
- The font ascent [height - descent].
275
-
276
- --start-unicode
277
-
278
- The start unicode codepoint for unprefixed files [0xEA01].
279
-
280
- --prepend-unicode
281
-
282
- Prefix files with their automatically allocated unicode codepoint.
283
-
284
- --metadata
285
-
286
- Content of the metadata tag.
287
- ```
288
-
289
194
  ### Exit codes
290
195
 
291
196
  The CLI can exit the process with the following exit codes:
292
197
 
293
- * 0: All ok.
294
- * 1: Something unknown went wrong.
295
- * Other: related to using packages.
198
+ - 0: All ok.
199
+ - 1: Something unknown went wrong.
200
+ - Other: related to using packages.
296
201
 
297
202
  ## Related
298
203
 
299
- * [Webpack plugin](https://github.com/itgalaxy/webfont-webpack-plugin) - `webpack` plugin.
300
- * [svgicons2svgfont](https://github.com/nfroidure/svgicons2svgfont) - Simple tool to merge multiple icons to an SVG font.
301
- * [svg2ttf](https://github.com/fontello/svg2ttf) - Converts SVG fonts to TTF format.
302
- * [ttf2eot](https://github.com/fontello/ttf2eot) - Converts TTF fonts to EOT format.
303
- * [ttf2woff](https://github.com/fontello/ttf2woff) - Converts TTF fonts to WOFF format.
304
- * [ttf2woff2](https://github.com/nfroidure/ttf2woff2) - Converts TTF fonts to WOFF2.
204
+ - [Webpack plugin](https://github.com/itgalaxy/webfont-webpack-plugin) - `webpack` plugin.
205
+ - [svgicons2svgfont](https://github.com/nfroidure/svgicons2svgfont) - Simple tool to merge multiple icons to an SVG font.
206
+ - [svg2ttf](https://github.com/fontello/svg2ttf) - Converts SVG fonts to TTF format.
207
+ - [ttf2eot](https://github.com/fontello/ttf2eot) - Converts TTF fonts to EOT format.
208
+ - [ttf2woff](https://github.com/fontello/ttf2woff) - Converts TTF fonts to WOFF format.
209
+ - [wawoff2](https://github.com/fontello/wawoff2) - Converts TTF fonts to WOFF2 and versa vice.
305
210
 
306
211
  ## Roadmap
307
212
 
308
- * The ability to generate from any type to any type.
309
- * More tests, include CLI test.
310
- * Improved docs.
311
- * Reduce package size (maybe implement `ttf2woff2` with native js library).
312
- * Improve performance (maybe use cache for this).
213
+ - The ability to generate from any type to any type.
214
+ - More tests, include CLI test.
215
+ - Improved docs.
216
+ - Reduce package size (maybe implement `ttf2woff2` with native js library).
217
+ - Improve performance (maybe use cache for this).
313
218
 
314
219
  ## Contribution
315
220