Skip to content

flashlizi/fontsubset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ...

About

A font subset extraction tool using google sfntly

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages