npm.io
1.0.3 • Published 7 years ago

fast-font-info

Licence
MIT
Version
1.0.3
Deps
0
Size
280 kB
Vulns
0
Weekly
0

Font Chars

Node.js Only

For What?

You can use this library to get the all char-code(unicode) from a font, supported format: TTF OTF WOFF

woff2 will be supported soon

How To
const cmap = require("font-chars");
const fontPath = "./fonts/segoeui.ttf";
cmap.loadCMap(fontPath, (err, result) => {
  console.log(result.glyphIndexArray);
});

glyphIndexArray :

glyphIndexArray = [[startUnicde, end], [start, end], [start, end]];
// include end value
License

This project is based on opentype.js If you want full support of reading font,getting glyph path,creating font ... on browser, the opentype.js is your best choice. All my code is under MIT License.The fonts in fonts dir is test only.