Skip to content

VdustR/font-splitter

Repository files navigation

Font Splitter

npm

Split the big font file into small subsets.

Font Splitter will split the font and generate a css with unicode-range just like Google fonts do.

Requirement

Installation

npm i -g font-splitter
yarn global add font-splitter

Usage

font-splitter [options] <fontPath>

Execute for help:

$ 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

Docker

docker run --rm -it -v </path/to/your/font>:/fonts vdustr/font-splitter <font.woff2> <options>

Build Your Image

docker build -t vdustr/font-splitter .