JSPM

convert-bmfont

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q30233F
  • License MIT

converts a BMFont from one format to another

Package Exports

  • convert-bmfont

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (convert-bmfont) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

convert-bmfont

stable

A command-line tool to convert a BMFont files from one format to another. Defaults to outputting a JSON representation for composition with other modules.

Installation:

npm install convert-bmfont -g

Usage:

#convert text to binary
convert-bmfont Arial.xml --format bin > Arial.bin

#convert to pretty-printed JSON
convert-bmfont Arial.fnt --pretty > Arial.json

Currently supported BMFont inputs:

  • XML
  • ASCII (text)
  • binary
  • JSON

Currently supported outputs:

  • JSON (default)
  • binary

See Also

See text-modules for related modules.

Usage

NPM

CLI

Prints result to stdout.

Usage:
  convert-bmfont input [opt]

Options:
  -f, --format   the format (bin, json) - default json
  -p, --pretty   pretty-print if output is json

API

convert(file, opt, cb)

Converts the file with the given options, and calls the cb on completion.

Opt:

  • format can be "json", "bin" (or "binary") - default json
  • pretty whether to pretty-print the JSON output
convert(__dirname+'/Blah.fnt', {
  pretty: true,
  format: 'json'
}, function(err, data) {
  if (err) throw err
  //data may be a Buffer or string
  process.stdout.write(data)
})

License

MIT, see LICENSE.md for details.