webfont 12.4.0 → 12.4.1

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/NOTICE.md CHANGED
@@ -1,4 +1,4 @@
1
- # webfont — Legal notice
1
+ # webfont — Legal Notices
2
2
 
3
3
  This document covers **copyright and licensing for fonts you process**, **disclaimers** about using the webfont software, **community attribution guidelines**, and **third-party open-source components** bundled with or used by this project.
4
4
 
package/README.md CHANGED
@@ -49,12 +49,71 @@ webfont is a technical tool. **Decompressing or generating fonts does not grant
49
49
 
50
50
  Full details, disclaimers, community attribution guidelines, and third-party library notices: **[NOTICE.md](./NOTICE.md)**.
51
51
 
52
+ ## Comparison with `webfonts`
53
+
54
+ `webfont` (this project) is sometimes confused with the older, **unmaintained** [`webfonts`](https://github.com/uipoet/webfonts) package (note the trailing `s`). `webfonts` last shipped around 2015 and requires a **Java** runtime (it bundles `batik-ttf2svg`, `sfnt2woff`, and `ttf2eot`). `webfont` is **pure JavaScript**, actively maintained, and does everything the *useful* parts of `webfonts` did — plus SVG-icon fonts, WOFF2, decompression, templates, and a Node.js API.
55
+
56
+ | Capability | `webfont` (this project) | `webfonts` ([uipoet/webfonts](https://github.com/uipoet/webfonts)) |
57
+ |------------|:------------------------:|:-----------------------------------------------------------------:|
58
+ | Maintained | ✅ | ❌ (last release ~2015) |
59
+ | Runtime | Pure JS (Node.js) | Node.js **+ Java** |
60
+ | SVG icons → font | ✅ (default pipeline) | ❌ |
61
+ | TTF input → web formats | ✅ | ✅ |
62
+ | Output: `woff2` (Brotli) | ✅ | ❌ |
63
+ | Output: `woff` / `eot` | ✅ | ✅ |
64
+ | Output: `svg` font | ✅ (`-f svg`, opt-in) | ✅ |
65
+ | Choose which formats to emit | ✅ (`-f` / `formats`) | ❌ (always `woff` + `eot` + `svg`) |
66
+ | WOFF/WOFF2 → TTF/OTF decompression | ✅ | ❌ |
67
+ | Node.js / programmatic API | ✅ (`webfont()`) | ❌ (CLI only) |
68
+ | CSS / SCSS / Styl templates | ✅ | ❌ (manual `@font-face` snippet) |
69
+ | Config files (cosmiconfig) | ✅ | ❌ |
70
+ | `.otf` as a **source** | ❌ ([tracking #767](https://github.com/itgalaxy/webfont/issues/767)) | ❌ ([requested](https://github.com/uipoet/webfonts/issues/4)) |
71
+
72
+ ### Migrating from `webfonts`
73
+
74
+ ```bash
75
+ # webfonts (unmaintained): converts a directory of TTFs, always emits woff + eot + svg
76
+ webfonts fonts/ -o dist/
77
+
78
+ # webfont: pick your formats explicitly (woff2 recommended for the web)
79
+ webfont "fonts/*.ttf" -f woff2,woff,eot,svg -d dist --dest-create
80
+ ```
81
+
82
+ `webfont` adds `woff2` (much smaller than the legacy formats), lets you emit only what you ship, and needs no Java toolchain.
83
+
84
+ ## Comparison with `grunt-webfont`
85
+
86
+ [`grunt-webfont`](https://github.com/sapegin/grunt-webfont) is the classic "SVG → webfont" **Grunt plugin** (~1.1k★, MIT). It is **archived** (read-only since 2021, last release `v1.2.0`), and its best-fidelity output relies on a native **FontForge** binary (its pure-`node` engine can't do ligatures). `webfont` is a framework-agnostic, actively maintained, pure-JS library **and** CLI: it does everything grunt-webfont *generated* — plus TTF encoding, WOFF/WOFF2 decompression, more templates, and programmatic hooks. The one thing grunt-webfont has that `webfont` doesn't is native Grunt wiring (tracked in [#771](https://github.com/itgalaxy/webfont/issues/771)); you can already drive `webfont()` from a small custom Grunt task.
87
+
88
+ | Capability | `webfont` (this project) | `grunt-webfont` ([sapegin/grunt-webfont](https://github.com/sapegin/grunt-webfont)) |
89
+ |------------|:------------------------:|:----------------------------------------------------------------------------------:|
90
+ | Maintained | ✅ | ❌ (archived 2021, `v1.2.0`) |
91
+ | Runtime | Node API **+ CLI** (any build tool) | **Grunt task only** |
92
+ | Engine | Pure JS (`svg2ttf`) | `node` **or** FontForge binary |
93
+ | SVG icons → font | ✅ | ✅ |
94
+ | Output formats | `svg, ttf, eot, woff, woff2` | `eot, woff2, woff, ttf, svg` |
95
+ | TTF input → web formats | ✅ | ❌ |
96
+ | WOFF/WOFF2 → TTF/OTF decompression | ✅ | ❌ |
97
+ | Stylesheets | `css, scss, styl, html, json` + custom Nunjucks, multiple per run | `css, sass, scss, less, stylus` + custom |
98
+ | CSS syntax presets (BEM / Bootstrap) | ❌ (use a custom template) | ✅ |
99
+ | `data:uri` embedding in CSS | ❌ | ✅ (`embed`) |
100
+ | Autohinting (`ttfautohint`) | via `ttfPostProcess` hook (external, opt-in) | built-in (`autoHint`) |
101
+ | Ligatures | ✅ (opt-in) | ✅ (FontForge engine only) |
102
+ | Codepoint map persistence | ❌ | ✅ (`codepointsFile`) |
103
+ | Programmatic API | ✅ (`webfont()`) | ❌ (Grunt only) |
104
+ | SVG diagnostics | ✅ (alpha) | ❌ |
105
+ | Grunt integration | ⏳ ([#771](https://github.com/itgalaxy/webfont/issues/771)) | ✅ (native) |
106
+
107
+ If you only need the generation that grunt-webfont did, `webfont` is a maintained, FontForge-free replacement. If you specifically need BEM/Bootstrap CSS presets or `data:uri` embedding today, use a [custom template](#template).
108
+
52
109
  ## Table Of Contents
53
110
 
54
111
  - [Webfont](#webfont)
55
112
  - [Features](#features)
56
113
  - [Input modes](#input-modes)
57
114
  - [Font licensing](#font-licensing)
115
+ - [Comparison with `webfonts`](#comparison-with-webfonts)
116
+ - [Comparison with `grunt-webfont`](#comparison-with-grunt-webfont)
58
117
  - [Installation](#installation)
59
118
  - [Usage](#usage)
60
119
  - [Options](#options)
@@ -68,7 +127,7 @@ Full details, disclaimers, community attribution guidelines, and third-party lib
68
127
  - [Roadmap](#roadmap)
69
128
  - [Contribution](#contribution)
70
129
  - [Changelog](#changelog)
71
- - [Legal notice](#legal-notice)
130
+ - [Legal Notices](#legal-notices)
72
131
  - [License](#license)
73
132
 
74
133
  ---
@@ -351,7 +410,7 @@ Notes:
351
410
 
352
411
  - Type: `string`
353
412
  - Default: Same as [`fontName`](#fontname) when not set.
354
- - Description: CSS `font-family` name emitted by built-in templates (`fontFamily` in Nunjucks context). Output **font files** are always named after `fontName` (for example `icons-a.woff2`); built-in templates reference those files with `{{ fontName }}` in `url(...)` while `font-family` uses `{{ fontFamily }}` ([#331](https://github.com/itgalaxy/webfont/issues/331)).
413
+ - Description: CSS `font-family` name emitted by built-in templates (`fontFamily` in Nunjucks context). Output **font files** are always named after `fontName` (for example `icons-a.woff2`); built-in templates reference those files with Nunjucks `fontName` / `fontFamily` placeholders in `url(...)` and `font-family` ([#331](https://github.com/itgalaxy/webfont/issues/331)).
355
414
 
356
415
  #### `templateCacheString`
357
416
 
@@ -867,6 +926,7 @@ The CLI can exit the process with the following exit codes:
867
926
  - [ttf2eot](https://github.com/fontello/ttf2eot) - Converts TTF fonts to EOT format.
868
927
  - [ttf2woff](https://github.com/fontello/ttf2woff) - Converts TTF fonts to WOFF format.
869
928
  - [wawoff2](https://github.com/fontello/wawoff2) - Converts TTF fonts to WOFF2 and versa vice.
929
+ - [fontTools](https://github.com/fonttools/fonttools) - Complementary low-level font toolkit (Python) for jobs webfont does not cover: subsetting, variable fonts, OpenType feature compilation, table editing, and TTX (font ⇄ XML). Generate the font with webfont, then inspect or optimize it with fontTools.
870
930
 
871
931
  ## Roadmap
872
932
 
@@ -882,7 +942,7 @@ Feel free to push your code if you agree with publishing under the MIT license.
882
942
 
883
943
  Check our [Changelog](CHANGELOG.md)
884
944
 
885
- ## Legal notice
945
+ ## Legal Notices
886
946
 
887
947
  Copyright, disclaimers, font licensing expectations (including WOFF/WOFF2 decompression), community attribution guidelines, and third-party open-source dependencies are documented in **[NOTICE.md](./NOTICE.md)**.
888
948
 
package/dist/cli.mjs CHANGED
@@ -28,7 +28,7 @@ import { Readable as _e } from "stream";
28
28
  import ve from "svg2ttf";
29
29
  //#region package.json
30
30
  var p, ye, be, xe, Se, Ce, we, Te, Ee, De, m, h, g, _, v, y, b, x, S, C, w, T, E, Oe, ke, Ae, je = r((() => {
31
- p = "webfont", ye = "12.4.0", be = "Generator of fonts from SVG icons; decompress WOFF/WOFF2 to embedded TTF/OTF (not TTF↔OTF transcoding)", xe = {
31
+ p = "webfont", ye = "12.4.1", be = "Generator of fonts from SVG icons; decompress WOFF/WOFF2 to embedded TTF/OTF (not TTF↔OTF transcoding)", xe = {
32
32
  lib: "dist",
33
33
  source: "src"
34
34
  }, Se = [
@@ -65,6 +65,12 @@ var p, ye, be, xe, Se, Ce, we, Te, Ee, De, m, h, g, _, v, y, b, x, S, C, w, T, E
65
65
  build: "vite build --mode library && vite build --mode library-esm && vite build --mode browser && vite build --mode cli && node scripts/emit-mts-types.mjs",
66
66
  clean: "rm -rf dist/ temp/",
67
67
  demo: "node dist/cli.mjs './src/fixtures/svg-icons/*.svg' -d demo -t html --normalize --center-horizontally",
68
+ "docs:build": "npm run build && npm run docs:site",
69
+ "docs:demo": "node dist/cli.mjs './src/fixtures/svg-icons/*.svg' -d public/font-demo -t html --normalize --center-horizontally --dest-create",
70
+ "predocs:site": "node -e \"require('node:fs').existsSync('dist/cli.mjs')||require('node:child_process').execSync('npm run build',{stdio:'inherit'})\"",
71
+ "docs:site": "npm run docs:demo && vitepress build",
72
+ "docs:dev": "vitepress dev",
73
+ "docs:preview": "vitepress preview",
68
74
  lint: "biome check .",
69
75
  "lint:suppressions": "node scripts/check-no-suppressions.mjs",
70
76
  typecheck: "tsc -p tsconfig.json --noEmit",
@@ -124,6 +130,7 @@ var p, ye, be, xe, Se, Ce, we, Te, Ee, De, m, h, g, _, v, y, b, x, S, C, w, T, E
124
130
  vite: "8.1.3",
125
131
  "vite-plugin-checker": "0.14.4",
126
132
  "vite-plugin-dts": "5.0.3",
133
+ vitepress: "1.6.4",
127
134
  vitest: "4.1.9"
128
135
  }, x = {
129
136
  minimatch: "10.2.5",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webfont",
3
- "version": "12.4.0",
3
+ "version": "12.4.1",
4
4
  "description": "Generator of fonts from SVG icons; decompress WOFF/WOFF2 to embedded TTF/OTF (not TTF↔OTF transcoding)",
5
5
  "directories": {
6
6
  "lib": "dist",
@@ -51,6 +51,12 @@
51
51
  "build": "vite build --mode library && vite build --mode library-esm && vite build --mode browser && vite build --mode cli && node scripts/emit-mts-types.mjs",
52
52
  "clean": "rm -rf dist/ temp/",
53
53
  "demo": "node dist/cli.mjs './src/fixtures/svg-icons/*.svg' -d demo -t html --normalize --center-horizontally",
54
+ "docs:build": "npm run build && npm run docs:site",
55
+ "docs:demo": "node dist/cli.mjs './src/fixtures/svg-icons/*.svg' -d public/font-demo -t html --normalize --center-horizontally --dest-create",
56
+ "predocs:site": "node -e \"require('node:fs').existsSync('dist/cli.mjs')||require('node:child_process').execSync('npm run build',{stdio:'inherit'})\"",
57
+ "docs:site": "npm run docs:demo && vitepress build",
58
+ "docs:dev": "vitepress dev",
59
+ "docs:preview": "vitepress preview",
54
60
  "lint": "biome check .",
55
61
  "lint:suppressions": "node scripts/check-no-suppressions.mjs",
56
62
  "typecheck": "tsc -p tsconfig.json --noEmit",
@@ -112,6 +118,7 @@
112
118
  "vite": "8.1.3",
113
119
  "vite-plugin-checker": "0.14.4",
114
120
  "vite-plugin-dts": "5.0.3",
121
+ "vitepress": "1.6.4",
115
122
  "vitest": "4.1.9"
116
123
  },
117
124
  "overrides": {