woff-parser

WOFF font parser

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
woff-parser
2.0.06 years ago8 years agoMinified + gzip package size for woff-parser in KB

Readme

WOFF font parser

Installation

npm install woff-parser

Usage

import fs from 'fs';
import parser from 'woff-parser';

fs.readFile('font.woff', (err, contents) => {
	if (err) throw err;
	parser(contents).then(result => {
		console.log(result);
	});
});

Outputs:
{
	...
	"name": {
		"format": 0,
		"nameRecords": {
			"English": {
				"fontFamily": "Source Sans Pro",
				"fontSubFamily": "Regular",
				"uniqueFontId": "1.050;ADBE;SourceSansPro-Regular;ADOBE",
				"fullName": "Source Sans Pro",
				"version": "Version 1.050;PS Version 1.000;hotconv 1.0.70;makeotf.lib2.5.5900",
				"postscriptName": "SourceSansPro-Regular",
				"licenseUrl": "http://www.adobe.com/type/legal.html"
			}
		}
	}
	...
}

Note:

wff-parser only implements the following font tables:
  • name
  • OS/2

Additional font tables will be implemented if requested. Pull requests are welcome.