Skip to content

extract subset of font from text content or website for CJK website

License

Notifications You must be signed in to change notification settings

bung87/font-extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

font-extractor Build Status Npm Version npm: total downloads Dep license

Installation

yarn add font-extractor -D

or

npm i --save-dev font-extractor

Usage

extract subset of font from text content or website for CJK website

supported format ttf, eot, woff, svg

puppeteer as peerDependencies if you'd like use headless mode extract from website

extract statically

font-extractor static -f test/lib/handfont.ttf -s test/index.html -o test/fonts/handfont

Options:
  --version        Show version number                                 [boolean]
  --source, -s     source glob pattern                                [required]
  --ignore, -i     ignore glob pattern
  --font, -f       font file path                                     [required]
  --preserved, -p  preserved words                         [array] [default: []]
  --encoding, -e   file encoding                     [string] [default: "utf-8"]
  --output, -o     output file path                                   [required]
  -c               config file
  --help           Show help                                           [boolean]

Example config file

{
    "source": {
        "path": ["src/**/*.vue"]
    },

    "font": "src/assets/fonts/站酷快乐体2016修订版.ttf",

    "output": "dist/fonts/站酷快乐体2016修订版.0aceab97.ttf"
}

extract from website

font-extractor headless -e http://139.198.17.136:8080/book/46 -o ./a.ttf --fname zkkl --ss '.books-wrapper' -f

Options:
  --version            Show version number                             [boolean]
  --help               Show help                                       [boolean]
  -c                   config file
  --entry, -e          entry url                                        [string]
  --output, -o         output file path                                 [string]
  --fontname, --fname  font face name
  --scroll, --ss       scroll element selector(querySelector)           [string]
  --font, -f           font file path                                   [string]
  --preserved, -p      preserved words                     [array] [default: []]

Acknowledgement

JailBreakC/font-collector)

purplebamboo/font-carrier

About

extract subset of font from text content or website for CJK website

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published