ttf-parser-node
v0.1.1
Published
WASM wrapper of ttf-parser for Node.js
Downloads
1
Readme
ttf-parser-node
WASM wrapper of ttf-parser for Node.js.
Example
const { fontsInCollection, Face } = require('ttf-parser-node');
const data = require('fs').readFileSync('path/to/truetypecollection.ttc');
const count = fontsInCollection(data);
const faces = Array(count).fill(0).map((_, i) => new Face(data, i));
faces.forEach(face => {
console.log(face.isRegular());
console.log(face.isItalic());
console.log(face.isVariable());
console.log(face.weight());
});