Skip to content

v1.0.0

Compare
Choose a tag to compare
@black7375 black7375 released this 10 Jan 01:21
· 14 commits to master since this release

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

Feature

  • fontSubset(): Subset based on text or text file
  • fontPipe(): Use fontRange() and fontSubset() 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

Test

image