{"_id":"@codelenny/load-bmfont","_rev":"3-b981e290b9676e3e8ea0fd80c11b5aca","name":"@codelenny/load-bmfont","description":"loads a BMFont file in Node and the browser","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@codelenny/load-bmfont","version":"1.0.0","description":"loads a BMFont file in Node and the browser","main":"index.js","browser":"browser.js","license":"MIT","author":{"name":"Ryan Leonard","url":"http://ryanleonard.us"},"contributors":[{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"}],"dependencies":{"buffer-equal":"0.0.1","mime":"^1.3.4","parse-bmfont-ascii":"^1.0.3","parse-bmfont-binary":"^1.0.5","parse-bmfont-xml":"^1.1.0","xhr":"^2.0.1","xtend":"^4.0.0"},"devDependencies":{"browserify":"^9.0.3","tap-spec":"^2.2.2","tape":"^3.5.0","testling":"^1.7.1"},"scripts":{"test-node":"node test.js | tap-spec","test-browser":"browserify test.js | testling | tap-spec","test":"npm run test-node && npm run test-browser"},"keywords":["bmfont","bitmap","font","angel","code","angelcode","parse","ascii","xml","text","json"],"repository":{"type":"git","url":"git://github.com/CodeLenny/load-bmfont.git"},"publishConfig":{"registry":"http://registry.npmjs.org/","access":"public"},"homepage":"https://github.com/CodeLenny/load-bmfont","bugs":{"url":"https://github.com/CodeLenny/load-bmfont/issues"},"gitHead":"54bcf9b7ca80b8306a1ca38a9a111c34aba49ea3","_id":"@codelenny/load-bmfont@1.0.0","_shasum":"f256d52b905d8c4bad83ff19b7decb45c13ecd94","_from":".","_npmVersion":"3.9.6","_nodeVersion":"5.8.0","_npmUser":{"name":"codelenny","email":"rhinoisnot@gmail.com"},"dist":{"shasum":"f256d52b905d8c4bad83ff19b7decb45c13ecd94","tarball":"https://registry.npmjs.org/@codelenny/load-bmfont/-/load-bmfont-1.0.0.tgz","integrity":"sha512-Yna65DFi9OPOBtGBzmENyCLJWPP9TzjL9zae4tGEuL57/4C3oTyNHFV71BmHQYAcQOwbG2GeyjCXdPUpXFpZog==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgwb9TelM4sS1BWGc9D8ZMFnJIRDLe8ApS/zk0KR5rawIgX5Gd2XTlQbgv8fd8fqEeMiydUqtOjrk5gSwxH7gLLkw="}]},"maintainers":[{"name":"codelenny","email":"rhinoisnot@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/load-bmfont-1.0.0.tgz_1478646125521_0.6858712616376579"}}},"readme":"# load-bmfont\n\n[![npm  version](https://img.shields.io/npm/v/@codelenny/load-bmfont.svg)](https://www.npmjs.com/package/@codelenny/load-bmfont)\n![stable](https://img.shields.io/badge/stability-stable-brightgreen.svg)\n[![Travis Build Status](https://travis-ci.org/CodeLenny/load-bmfont.svg?branch=master)](https://travis-ci.org/CodeLenny/load-bmfont)\n[![MIT Licensed](https://img.shields.io/npm/l/CodeLenny/load-bmfont.svg)](http://github.com/CodeLenny/load-bmfont/blob/master/LICENSE.md)\n\n[![Testling Build Status](https://ci.testling.com/CodeLenny/load-bmfont.png)](https://ci.testling.com/CodeLenny/load-bmfont)\n\nLoads an [AngelCode BMFont](http://www.angelcode.com/products/bmfont/) file from XHR (in browser) and fs (in Node), returning a [JSON representation](json-spec.md).\n\n```js\nvar load = require('@codelenny/load-bmfont')\n\nload('fonts/Arial-32.fnt', function(err, font) {\n  if (err)\n    throw err\n\n  //The BMFont spec in JSON form\n  console.log(font.common.lineHeight)\n  console.log(font.info)\n  console.log(font.chars)\n  console.log(font.kernings)\n})\n```\n\nCurrently supported BMFont formats:\n\n- ASCII (text)\n- JSON\n- XML\n- binary\n\n## See Also\n\nSee [text-modules](https://github.com/mattdesl/text-modules) for related modules.\n\n## Usage\n\n[![NPM](https://nodei.co/npm/load-bmfont.png)](https://www.npmjs.com/package/load-bmfont)\n\n#### `load(opt, cb)`\n\nLoads a BMFont file with the `opt` settings and fires the callback with `(err, font)` params once finished. If `opt` is a string, it is used as the URI. Otherwise the options can be:\n\n- `uri` or `url` the path (in Node) or URI (in the browser)\n- `binary` boolean, whether the data should be read as binary, default false\n- (in node) options for `fs.readFile`\n- (in browser) options for [xhr](https://github.com/Raynos/xhr)\n\nTo support binary files in the browser and Node, you should use `binary: true`. Otherwise the XHR request might come in the form of a UTF8 string, which will not work with binary files. This also sets up the XHR object to override mime type in older browsers.\n\n```js\nload({\n  uri: 'fonts/Arial.bin',\n  binary: true\n}, function(err, font) {\n  console.log(font)\n})\n```\n\n## License\n\nMIT, see [LICENSE.md](http://github.com/CodeLenny/load-bmfont/blob/master/LICENSE.md) for details.\n","maintainers":[{"name":"codelenny","email":"rhinoisnot@gmail.com"}],"time":{"modified":"2022-06-12T16:20:21.480Z","created":"2016-11-08T23:02:07.289Z","1.0.0":"2016-11-08T23:02:07.289Z"},"homepage":"https://github.com/CodeLenny/load-bmfont","keywords":["bmfont","bitmap","font","angel","code","angelcode","parse","ascii","xml","text","json"],"repository":{"type":"git","url":"git://github.com/CodeLenny/load-bmfont.git"},"contributors":[{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"}],"author":{"name":"Ryan Leonard","url":"http://ryanleonard.us"},"bugs":{"url":"https://github.com/CodeLenny/load-bmfont/issues"},"license":"MIT","readmeFilename":"README.md"}