Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ $ font-splitter
Usage: font-splitter [options] <fontPath>

Options:
-v, --version output the version number
-c, --chunk <chunk> chunk size, `-` stand for infinity, default: 256
-f, --flavor <flavor> font flavor: woff, woff2
-n, --family <family> font family, default: parsed from font
-i, --italic italic font style, default: false
-w, --weight <weight> font weight, default: 400
-d, --dry dry run
-q, --quite disable stdout
-o, --output <output> output directory
-h, --help output usage information
-v, --version output the version number
-c, --chunk <chunk> chunk size, `-` stand for infinity, default: 256
-f, --flavor <flavor> font flavor: woff, woff2
-n, --family <family> font family, default: parsed from font
-i, --italic italic font style, default: false
-w, --weight <weight> font weight, default: 400
-d, --dry dry run
-q, --quite disable stdout
-o, --output <output> output directory
-b, --batches <batches> number of chunks to split in parallel, default: 4
-h, --help output usage information
```

## Docker
Expand Down
4 changes: 4 additions & 0 deletions bin/font-splitter
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ program.option('-w, --weight <weight>', 'font weight, default: 400', parseInt);
program.option('-d, --dry', 'dry run');
program.option('-q, --quite', 'disable stdout');
program.option('-o, --output <output>', 'output directory');
program.option('-b, --batches <batches>', 'number of chunks to split in parallel, default: 4', parseInt);
program.arguments(`<fontPath>`).action(target => {
fontPath = resolve(target);
});

program.parse(process.argv);

const flavor = program.flavor || 'woff2';
Expand All @@ -45,6 +47,7 @@ const italic = program.italic;
const weight = program.weight || 400;
const dryRun = program.dry;
const quite = program.quite;
const batches = program.batches || 4;

if (!fontPath) {
quit();
Expand All @@ -66,4 +69,5 @@ split({
weight,
dryRun,
quite,
batches,
});
Loading