1.0.2 • Published 5 years ago

fast-font-cmap v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

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.