Socket
Socket
Sign inDemoInstall

parse-bmfont-binary

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    parse-bmfont-binary

reads a BMFont binary in a Buffer into a JSON object


Version published
Weekly downloads
1.1M
increased by2.2%
Maintainers
1
Install size
7.67 kB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 27 Apr 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc