GT2/Ejectable/node_modules/parse-bmfont-binary
Ren Juan 06c1a5835d set clean start from expo 4.10 2021-08-16 00:14:59 +00:00
..
LICENSE.md set clean start from expo 4.10 2021-08-16 00:14:59 +00:00
README.md set clean start from expo 4.10 2021-08-16 00:14:59 +00:00
index.js set clean start from expo 4.10 2021-08-16 00:14:59 +00:00
package.json set clean start from expo 4.10 2021-08-16 00:14:59 +00:00

README.md

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.