read-font-cmap
A Node module to parse CMap of a TrueType/OpenType font file
var readFontCmap = ; ;
Installation
npm install read-font-cmap
API
var readFontCmap = ;
readFontCmap(filePath, callback)
filePath: String
(font file path)
callback: Function
It reads and parses a TrueType/OpenType font file asynchronously, then runs callback function.
callback(error, cmap)
error: Object
(an error if it fails to parse the font, otherwise null
)
cmap: Object
The second argument represents CMap table in the form:
Here is a real-life example, the result of parsing Font Awesome CMap table.
readFontCmap.sync(filePath)
filePath: String
(font file path)
Return: Object
(CMap table)
Synchronous version of readFontCmap
.
var readFontCmap = ;readFontCmap;//=> {"32": 1, "168": 6, "169": 12, "174": 10, ... }
License
Copyright (c) 2014 Shinnosuke Watanabe
Licensed under the MIT License.