DevTools Logo

Web Font Subsetter & Glyph Stripper

Web Font Subsetter & Glyph Stripper

Analyze font glyph usage and generate a deterministic pyftsubset plan locally in your browser

Choose a font

Client-side font analysis reads the sfnt table directory and cmap format 4. It produces a deterministic pyftsubset command and unicode-range CSS; it does not modify or upload the font.

Examples

Delta-mapped glyph lookup

Input
readCmapFormat4(font, parseSfntTables(font).tables).mapping.get(0x41)
Output
0x42

Code point U+0041 resolves through its format 4 segment delta.

Deterministic subset command

Input
buildPyftsubsetCommand("Brand.ttf", [0x42, 0x41, 0x41])
Output
pyftsubset "Brand.ttf" --output-file="Brand-subset.ttf" --unicodes=U+0041,U+0042

Code points dedupe, sort ascending, and render with quoted paths.

About this tool

Font Subsetter Glyph Stripper plans webfont subsetting with analyzeFont(input, requestedCharacters, fileName): the sfnt or WOFF table directory parses, cmap format 4 maps requested code points to glyph ids, and the report bundles savings, pyftsubset command, unicode-range, and CSS.

Parsing is strict and explicit: TrueType, OTTO, true, typ1, and wOFF signatures are accepted, each 16-byte directory entry contributes tag, checksum, offset, and length, missing cmap tables throw, and format 4 segments resolve through delta and range-offset lookups.

Output is deterministic: unicodeRanges collapses code points to U+0041-0043 spans, buildPyftsubsetCommand sorts and dedupes unicodes with quoted file names, and estimatedSavingsPercent derives from the share of unique mapped glyphs against maxp numGlyphs clamped to 0-99.

How to use this tool

  1. Load the font bytes

    Provide a non-empty sfnt or WOFF ArrayBuffer with a cmap table.

  2. Enter requested text

    Type the characters the subset must keep — others map to savings.

  3. Read the mapping

    Check mappedGlyphs against unmappedCodePoints for coverage gaps.

  4. Copy the subset command

    Run the generated pyftsubset line and paste the CSS unicode-range.

Use cases

Slimming webfonts

Keep only headline characters and ship a fraction of the original file.

Auditing glyph coverage

Find which requested code points lack glyphs before subsetting.

Generating subset CSS

Copy the unicode-range declaration for a @font-face block.

Common mistakes

Mistake:Feeding a non-font file and expecting an empty report.

Fix:Unknown signatures throw Invalid font — only sfnt and WOFF binaries parse.

Mistake:Assuming every character maps to a glyph.

Fix:Check unmappedCodePoints; missing glyphs never enter the subset command.

Mistake:Hand-editing unicodes out of order.

Fix:The command sorts and dedupes automatically — paste code points in any order.

Frequently asked questions

What does this tool do?

It analyzes sfnt and WOFF fonts with analyzeFont, mapping requested characters through cmap format 4 to glyph ids and reporting savings, a pyftsubset command, unicode-range, and subset CSS.

How are tables parsed and glyphs resolved?

The 16-byte table directory yields tag, checksum, offset, and length per entry, format 4 segments resolve via delta and range-offset lookups, and the savings estimate compares unique mapped glyphs against maxp numGlyphs clamped to 0-99.

Is my font uploaded or stored?

No. Directory parsing, cmap lookups, and command generation run entirely in your browser.

Why an invalid-font error, or unmapped characters?

Undersized buffers, unknown signatures, and missing cmap tables throw, and requested code points without glyphs land in unmappedCodePoints instead of the subset command.

References & standards

.env Secret Safety Linter

Validate .env syntax and spot likely leaked credentials or placeholder secrets.

.htaccess Generator

Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth

2D Fluid Dynamics & Particle Physics Sandbox

A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.

AI Function Calling Schema Generator

Generate function calling JSON schemas from TypeScript interfaces

Algorithm Arena & Data Structure Visualizer

Interactive arena for algorithms and data structures: eight sorting algorithms racing on one seeded input, six pathfinding algorithms walking generated mazes, and BST, AVL, Red-Black, B-tree, heap and trie operations replayed step by step with rotations highlighted. Every run shows the Big-O table and the phase-highlighted reference implementation in four languages, and compared values can be played as pitch (sonification) through the shared audio engine. Everything runs client-side; inputs never leave the browser.

Ansible Playbook Generator

Build an Ansible playbook — hosts, vars, and tasks with modules — as YAML