Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/strarsis/font-chars
Lists the unicode codepoints/characters of a font loaded by opentype.js
https://github.com/strarsis/font-chars
Last synced: 13 days ago
JSON representation
Lists the unicode codepoints/characters of a font loaded by opentype.js
- Host: GitHub
- URL: https://github.com/strarsis/font-chars
- Owner: strarsis
- License: mit
- Created: 2015-10-26T14:48:25.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-24T16:20:04.000Z (almost 9 years ago)
- Last Synced: 2024-10-18T23:55:24.573Z (about 1 month ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# font-chars
Lists the unicode codepoints/characters of a font loaded by opentype.js[![david](https://david-dm.org/strarsis/font-chars.svg)](https://david-dm.org/strarsis/font-chars)
Heavily inspired by [character-map](https://www.npmjs.com/package/character-map) (which is a CLI tool).
Usage
-----
````
npm install font-chars
````````
var opentype = require('opentype.js')
, fontChars = require('font-chars');opentype.load('./path/to/font.ttf', function(err, font) {
if (err) {
console.log(err);
return;
}console.log(fontChars.getCodepoints(font));
});
````The returned array contains unicode code points, they can be converted into human readable characters if needed.