1.0.0 • Published 9 years ago

unpack-bmfonts v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

unpack-bmfonts

experimental

Unpacks a binary buffer of packed BMFont objects. See the spec for binary details, or pack-bmfonts to generate the binary file.

var unpack = require('unpack-bmfonts')

fs.readFile('packed-fonts.bin', function(err, data) {
  var fonts = unpack(data)
  
  //the array of BMFont JSON objects  
  console.log(fonts)

  console.log(fonts[0].common.lineHeight)
  console.log(fonts[0].info.face)
})

Usage

NPM

fonts = unpack(buffer)

Unpacks a Buffer of packed binary fonts.

License

MIT, see LICENSE.md for details.