npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

font-extractor

v1.5.3

Published

## Installation

Downloads

19

Readme

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

install puppeteer dependencies on CentOS
yum install pango.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXtst.x86_64 cups-libs.x86_64 libXScrnSaver.x86_64 libXrandr.x86_64 GConf2.x86_64 alsa-lib.x86_64 atk.x86_64 gtk3.x86_64 ipa-gothic-fonts xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc -y

[recommended] Enable user namespace cloning

sudo sysctl -w kernel.unprivileged_userns_clone=1

extract statically

extract from local files literal string.

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

extract text styled with specific font face name in web page.

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
  --scroller, --ss       scroll element selector(querySelector)           [string]
  --scrollwait --sw    time wait after scroll(ms) default:300
  --font, -f           font file path                                   [string]
  --preserved, -p      preserved words                     [array] [default: []]

Example config

{
    "fname":"zkkl",
    "ss":".books-wrapper",
    "p":["外","社" ,"三" ,"七","商务", "雅思","北师大","初","高中","修","小","教","十","一","上","下","册"],
    "font": "src/assets/fonts/站酷快乐体2016修订版.ttf",
    "entry":"http://139.198.17.136:8080/",
    "output": "dist/fonts/站酷快乐体2016修订版.0aceab97.ttf",
    "pages":["[60 to 80].map (x)-> 'http://139.198.17.136:8080/book/' + x "]
}

Acknowledgement

JailBreakC/font-collector

purplebamboo/font-carrier