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 🙏

© 2026 – Pkg Stats / Ryan Hefner

glypher

v1.2.3

Published

Fast and efficient font manipulation tool

Readme

glypher

Fast and efficient font manipulation tool.

npm version License: MIT npm

Glypher is a successor of glyphhanger, providing fast and efficient font manipulation tools. You had to install external tools like pyftsubset, brotli or zopfli to enable specific features. This project focuses on providing all the features in a single tool without the need for external installations or dependencies.

The glypher CLI provides a TypeScript interface that wraps the core WebAssembly functionality for font subsetting and conversion operations.

Features

  • Subset fonts to include only specific glyphs
  • Convert fonts to different formats (WOFF, WOFF2)
  • Crawl websites to extract glyphs
    • Limitation: CSR, SSR websites not fully supported since content might be added after page load
  • Use predefined Unicode ranges for common scripts
  • Use best matching ranges instead of exact glyphs
  • Use Unicode code points or glyph IDs
  • Use range notation or U+ notation
  • Use hex notation or plain hex (without prefix)

Installation

npm install -g glypher

Or use with npx:

npx glypher [options]

Usage

Glypher uses a unified command structure where you can subset, convert, or do both in a single command.

npx glypher -i <input> [-o <output>] [-f <format>] [-g <glyphs>] [-r <ranges...>]

Options

| Option | Alias | Description | Required | |--------|-------|-------------|----------| | --input <path> | -i | Input font file | Yes (except with --crawl only) | | --output <path> | -o | Output font file | When subsetting without format | | --format <format> | -f | Convert to format: woff or woff2 | No | | --glyphs <glyphs> | -g | Glyphs to subset (Unicode code points or glyph IDs) | No | | --range <ranges...> | -r | Predefined character range(s) for subsetting | No | | --crawl | | Crawl a website to extract glyphs | No | | --url <url> | -u | URL to crawl (requires --crawl) | When using --crawl | | --depth <depth> | -d | Crawl depth (0 = single page only, default: 0) | No | | --use-range | | Use best matching range instead of exact glyphs (with --crawl) | No |

Note: At least one of --format, --glyphs, --range, or --crawl must be specified.

Examples

Convert Only

Convert a font file to WOFF2 format:

npx glypher -i input.ttf -f woff2

Convert to WOFF format:

npx glypher -i input.ttf -f woff

Convert with explicit output path:

npx glypher -i input.ttf -f woff2 -o output.woff2

Subset Only

Subset a font to include only specific glyphs:

Using predefined ranges (recommended for language support):

# Single range
npx glypher -i input.ttf -o output.ttf -r LATIN_BASIC

# Multiple ranges
npx glypher -i input.ttf -o output.ttf -r LATIN_BASIC GREEK

# Extended Latin support
npx glypher -i input.ttf -o output.ttf -r LATIN_EXTENDED

Using Unicode code points:

# Using U+ notation
npx glypher -i input.ttf -o output.ttf -g U+0041,U+0042,U+0043

# Using hex notation (0x prefix)
npx glypher -i input.ttf -o output.ttf -g 0x0041,0x0042,0x0043

# Using plain hex (without prefix)
npx glypher -i input.ttf -o output.ttf -g 0041,0042,0043

Using glyph IDs (font-specific):

npx glypher -i input.ttf -o output.ttf -g 36,37,38

Subset and Convert

Subset a font and convert to WOFF2 in a single command:

npx glypher -i input.ttf -f woff2 -g U+0041,U+0042,U+0043 -o output.woff2

Using predefined ranges with conversion:

npx glypher -i input.ttf -f woff2 -r LATIN_BASIC -o output.woff2

You can omit -o when using -f, and the output filename will be auto-generated:

npx glypher -i input.ttf -f woff2 -r LATIN_BASIC
# Outputs: input.woff2

Website Crawling

Crawl a website to discover which glyphs are actually used:

Basic crawl (analyze only):

npx glypher --crawl -u https://example.com

Crawl with depth (follow links):

# Crawl the page and one level of linked pages
npx glypher --crawl -u https://example.com -d 1

# Crawl two levels deep
npx glypher --crawl -u https://example.com -d 2

Crawl and subset a font with exact glyphs found:

npx glypher --crawl -u https://example.com -i input.ttf -o output.ttf

Crawl and subset using the best matching range:

npx glypher --crawl -u https://example.com -i input.ttf -o output.ttf --use-range

Crawl, subset, and convert in one command:

npx glypher --crawl -u https://example.com -i input.ttf -f woff2 -o output.woff2

Crawl with range matching and convert:

npx glypher --crawl -u https://example.com -i input.ttf -f woff2 --use-range

Output Path Behavior

  • When using --format without --output: Output file uses the input filename with the new extension (e.g., input.ttfinput.woff2)
  • When only subsetting without --output: Output file is auto-generated as <input>-subset.<ext> (e.g., input.ttfinput-subset.ttf)
  • When --output is specified: Uses the exact path provided

Notes

  • Unicode code points are font-independent and recommended for subsetting
  • Glyph IDs are font-specific and may vary between fonts
  • Predefined ranges are useful for ensuring full language support
  • The --use-range flag with --crawl helps ensure you include a complete character set rather than only the exact glyphs found
  • Website crawling works best with static HTML content; dynamically loaded content (CSR/SSR) may not be captured

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines on how to contribute to this project.

Reporting Issues

Issues are welcomed! If you encounter a bug or have a feature request, please open an issue.