fontsubset

0.2.0 • Public • Published

A font subset extraction tool using google sfntly.

You can use it get a tiny font size, especially for webfont.

Install

npm install fontsubset -g

Note: Java is required.

Usage

fontsubset [options] fontFile [outputFile]

Options

-s, --string [string]  subset string to extract
-t, --text [file:file ...]      the text file included subset strings to extract
-b, --base64           output font subset in base64 format
-h, --help             output usage information
-V, --version          output the version number

Examples

fontsubset -s 'Hello World' font/arial.ttf output/arial-subset.ttf
fontsubset -s '世界,你好!' font/微软雅黑.ttf output/微软雅黑-subset.ttf

Use text file:

fontsubset -t text-cn.txt font/微软雅黑.ttf output/微软雅黑-subset.ttf

multi text files:

fontsubset -t text-cn-1.txt:text-cn-2.txt font/微软雅黑.ttf output/微软雅黑-subset.ttf

Use : to split multi files , because ... it is a long story ...

Readme

Keywords

Package Sidebar

Install

npm i fontsubset

Weekly Downloads

26

Version

0.2.0

License

none

Unpacked Size

10.5 MB

Total Files

4

Last publish

Collaborators

  • flashlizi