Releases: black7375/font-range
Releases · black7375/font-range
v1.0.2
v1.0.0
Breaking Change
fontRange()
API
// Old
fontRange(css_url_or_path, font_path);
fontRange(css_url_or_path, font_path, save_path); // Option1
fontRange(css_url_or_path, font_path, { ...options ); // Option2
// New
fontRange(font_path, css_url_or_path);
fontRange(font_path, css_url_or_path, save_dir); // Option1
fontRange(font_path, css_url_or_path, { ...options }); // Option2
Environment
- Node:
v12.13
->v16.16
(v12
is deprecated) - NPM -> Yarn Berry
- Bump packages
Feature
fontSubset()
: Subset based on text or text filefontPipe()
: UsefontRange()
andfontSubset()
to perform multiple subset operations
// fontSubset
fontRange(font_path);
fontRange(font_path, save_dir); // Option1
fontRange(font_path, { ...options }); // Option2
// fontPipe
fontPipe([
{ font_path }, // As `fontSubset(font_path)`
{ font_path, option: { text: "abc" } }, // As `fontSubset(font_path, { text: "abc" })`
{ font_path, option: { textFile: file_path } }, // As `fontSubset(font_path, { textFile: file_path })`
{ font_path, option: { cssFile: css_url_or_path } } // As `fontRange(font_path, css_url_or_path)`
]);
fontPipe([{ font_path1 }, { font_path2 }], "<index>/<total>"); // Sharding option use like `1/2`
Performace
- Shell creation removal: Reduces job start delay
- Worker pool: Execute subset operations using CPU as much as possible
- Shard: Supports subset pipelines in distributed environments