@lassehaslev/font-subsetter

Subset fonts with single regular expression

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@lassehaslev/font-subsetter
000.1.05 years ago5 years agoMinified + gzip package size for @lassehaslev/font-subsetter in KB

Readme

@lassehaslev/font-subsetter

Install

npm install @lassehaslev/font-subsetter

Usage

// Get font subsetter class
var FontSubseter = require( '@lassehaslev/font-subsetter' );

// Create instance
var subsetter = new FontSubseter( filePath, {
    regex: new RegExp( regex ),
} );


// -- Subset -- //
// To file
subsetter.subset().toFile( path );

// Subset to base64
subsetter.subset().toBase64();

// -- Other functions -- //
// Get all characters matching regex
subsetter.characters();

// Get all charcodes matching regex
subsetter.charCodes();