parse-bmfont-binary
reads a BMFont binary in a Buffer into a JSON object
Last updated 10 years ago by mattdesl .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install parse-bmfont-binary 
SYNC missed versions from official npm registry.

parse-bmfont-binary

stable

Encodes a BMFont from a binary Buffer into JSON, as per the BMFont Spec. Can be used in Node or the browser (e.g. with browserify).

var parse = require('parse-bmfont-binary')

fs.readFile('fonts/Lato.bin', function(err, data) {
  if (err) throw err
  var font = parse(data)
  
  //do something with your font
  console.log(font.info.face)
  console.log(font.info.size)
  console.log(font.common.lineHeight)
  console.log(font.chars)
  console.log(font.kernings)
})

See Also

See text-modules for related modules.

Usage

NPM

font = parse(buffer)

Reads a binary BMFont Buffer and returns a new JSON representation of that font. See here for details on the return format.

License

MIT, see LICENSE.md for details.

Current Tags

  • 1.0.6                                ...           latest (10 years ago)

3 Versions

  • 1.0.6                                ...           10 years ago
  • 1.0.5                                ...           10 years ago
  • 1.0.4                                ...           10 years ago
Maintainers (1)
Downloads
Total 2
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE